-
-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Confused about partial-app-loading #1080
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
Make a new object from your props and set activeRoute. The error is from React because it doesn't want you to set this.props, they should only be passed into the component from a parent. var props = this.props;
props.activeRoute = <RouteHandler/>;
return <Component {...props}/>; |
@rgrwkmn That didn't help. Still getting the warning message. |
Ah, right, you need to actually make a new object, just setting it to another variable still references this.props. If you use underscore or something like it, this works: var props = _.extend({}, this.props);
props.activeRoute = <RouteHandler/>;
return <Component {...props}/>; |
That did the trick. Should I keep the issue open so the official example code can be updated? |
go check out the new |
I've used the partial-app-loading example to build a similar process in my app, but now I'm seeing this warning message in the console:
Is the example out of date? Is there another way I should be setting the RouteHandler? The example shows the code as:
The text was updated successfully, but these errors were encountered: