-
Notifications
You must be signed in to change notification settings - Fork 674
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
Multiple @connect decorators? #17
Comments
@eelkeh I think this depends on the goals you are trying to achieve. If you add the main reducers to the top component. They will automatically trigger a rerender if your data changes. Hence you could as well pass your data down. If some components in your hierarchy only depend on parts of the 'main' reducers I would suggest to add finer grained selectors on the root component and other connectors on the components deeper down. e.g. in case of a form depending on your data you could select the complete form data at the root of your compound form component or you could create selectors for each form field and the selector at the root level could completely be removed. Was this answer helpful for you? |
I agree with @speedskater, it depends! I will add that I don't think using reselect means you should split your app into smart and dumb components any differently. |
Just asking, not sure about the best practice here.
Say a component deep in the tree needs a derived or composed state, all the "main" stores are declared on the root component... is it considered good practice to add another
@connect
on the deep component, or should we pass the derived state down from the root component too?The text was updated successfully, but these errors were encountered: