Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- addRoute(element, parent) {
- // Get the component, path, and children props from a given child
- const { component, path, children } = element.props;
- const render = (params, renderProps) => {
- const finalProps = Object.assign({ params }, this.props, renderProps);
- const children = React.createElement(component, finalProps);
- return parent ? parent.render(params, { children }) : children;
- };
- ....
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement