-
Notifications
You must be signed in to change notification settings - Fork 11
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
Direct state in context #26
Conversation
@markerikson You might have some technical interests in this. I'm not sure how react-redux v6 is implemented at code level, but what I'm trying here is to put |
I would generally expect that propagating state via context is going to be a noticeable drop in performance. because that's what we saw with v6. |
@markerikson It's not that bad. I think it's different from rr v6, in which context propagate all components and HoCs stop updating. Whereas, this one, context doesn't propagate, but calls listeners in |
This is not correct in this case, because it is in useEffect. |
Run js-framework-benchmark again. This time, the control is react-redux v7.1.0. I'm pretty confident that performances are fine. Only the comparison is:
Which is better? A hard question. Anyone have comments? Our hero @gaearon |
My intuition is go for it. I would expect when React would drop the I would appreciate for any comments even after this PR is merged. Thanks. |
As it went well in https://github.com/dai-shi/react-tracked, I'm trying the same technique in reactive-react-redux too.
We put redux state in context and set observedBits = 0.
This should hopefully resolve the concurrent mode issue (but who knows what is concurrent mode...)
Closes #15, unless we further see other concurrent mode issues (in this case file a new issue).