Advertisement
Guest User

Untitled

a guest
Oct 15th, 2019
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. addRoute(element, parent) {
  2. // Get the component, path, and children props from a given child
  3. const { component, path, children } = element.props;
  4.  
  5. const render = (params, renderProps) => {
  6. const finalProps = Object.assign({ params }, this.props, renderProps);
  7. const children = React.createElement(component, finalProps);
  8. return parent ? parent.render(params, { children }) : children;
  9. };
  10. ....
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement