-
Notifications
You must be signed in to change notification settings - Fork 47k
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
react-art + React Context API is not working correctly #12796
Comments
Have you tried on master? I think #12779 fixed this (although the solution is a bit gross). For it to work you’ll need to specify whether your renderer is “primary” or “secondary” (and more than two won’t work). |
I’ll assume it’s fixed but if not let me know. |
@gaearon |
@gaearon I looked into this. It seems like popping the context Provider isn't safe if a child might call a secondary renderer after the primary renderer commits. |
@gaearon the context is being shared successfully between the renderers, with ReactDOM being the primary renderer. I believe the reason this wasn't caught was because the test added for The example @lavrton renders the Provider outside of the |
I'll close this in favor of #13332 (which I think is the real issue here). |
@gaearon is react-art using |
No, because Portals would be the mechanism by which you put one renderer into another. |
I also filed #13336 which is a bit more concrete about this use case. |
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
When you use
react-art
rendrer, theConsumer
is picking up the default value defined by the initial creation of the context rather than the values provided by Provider.Actual behabiour:
Shape
hasy = 10
(initial value).Demo: https://codesandbox.io/s/llx6kv6527
What is the expected behavior?
Shape
should havey = 100
(provided value).v16.3.2 for
react
,react-dom
andreact-art
The text was updated successfully, but these errors were encountered: