Relying on ownProps in mapStateToProps disables some optimizations in React Redux.
We should mention this in the docs of both projects, and also include this neat tip on how ownProps can be avoided for many cases.
Contributions are welcome!
Example of this in practice: https://github.com/mweststrate/redux-todomvc/pull/1/commits/e5d25f047ff62c1eddd2b3ad2a62a7b4638ee52e
Gives ~3x perf boost in my testing.
In fact a lot of thinking in https://github.com/mweststrate/redux-todomvc/pull/1 is non-obvious to beginners and even advanced users. We should have an optimization guide that explains _how_ to find the optimization sweet spots and use them.
Yeah. That and a "Structuring Reducers" recipe would be great additions to the docs. I'm kinda busy at the moment, but might be able to help out at some point.
As a side note, I'm rather amused to see that you've adopted strictly passing IDs to children as a viable option for some use cases, given a couple of your earlier comments against it. :)
Obviously reasons to do both, depending on the situation.
It really depends on whether I鈥檓 trying to keep components more reusable or optimize the hell out of their updates.
Great! thanks @gaearon
Let's roll this up into #1783. It should definitely be covered there!
Most helpful comment
In fact a lot of thinking in https://github.com/mweststrate/redux-todomvc/pull/1 is non-obvious to beginners and even advanced users. We should have an optimization guide that explains _how_ to find the optimization sweet spots and use them.