Closed
Description
Ok, this is really hard to explain so I've set up an example here:
https://github.com/epeli/redux-connect-demo
Build it and play with it with devtools console opened. You should see following errors:
Uncaught TypeError: Cannot read property 'foo' of undefined
This happens because the mapStateToProps
of the Item
component is called with component props based on the previous store state. The two states are not compatible anymore and it causes all kinds of errors.
I think the parent should render and update the props for the Item
component before the mapStateToProps
of the Item
component can be executed.
Metadata
Metadata
Assignees
Labels
No labels