-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Confusing documentation #83
Comments
Notice it says "a" top-level component, not "the" top-level component. You can, and probably should, In my opinion, more calls to The downside though, is that it ties a component to a given app, because the component needs to know the shape of the state object. If you don't want to reuse the code though, then that's not really a downside. It's generally better to have a handful of "smart" components that know about the app, and have them rely on "dumb" components that render entirely from props. If you're not using it already, look into reselect too. They are about to go 1.0. You may also be able to take advantage of React's |
@arkwright I believe you are slightly misinterpreting the point of the the readme where is says
The example is showing an connect select function that maps the entire state to the connected component
In any application of reasonable size this is likely unnecessary since parts of your state are likely not of concern for the given connected component. The point about performance is recognizing that in this given example the component will be re-rendered anytime any state changes even if it isn't relevant to the connected component. I think the readme example could probably make this a little more clear so that future readers don't also come away with the impression you did. Hopefully that helps clear things up. Thanks, |
clarifying admonition against listening to the entire state in `connect()` resolves #83
👍 |
Redux docs state:
https://rackt.github.io/redux/docs/basics/UsageWithReact.html
But, in a seeming contradiction, react-redux README states:
I'm not sure whose advice to follow!
The text was updated successfully, but these errors were encountered: