-
-
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
Connected component prevents all context propagations #144
Comments
Related facebook/react#2517 |
One possible solution to this is to check only state in This seems like a reasonable default behavior to me — check in shouldComponentUpdate only stuff we manage (this.state), and delegate any other checks to user's components. |
The only better option that using Related: |
This should fix reduxjs#144
Well this is what I'm trying to do :) I've made a PR with a possible fix #149 It requires a bit more work, but I wanted to ask first if this idea makes sense. |
Oh, I meant libraries-relying-on-context-propagation, e.g. remix-run/react-router#470. Longer term it's React's problem, but there are feasible workaround for specific libs today. |
Because connected components have aggressive
shouldComponentUpdate
, andshouldComponentUpdate
doesn't support context, connected components basically stop any other context variables changes to propagate to their children.Is there a recommended solution to this problem? I found
pure
option (connect(..., {pure: false})
), which helps, but is there a better way?The text was updated successfully, but these errors were encountered: