-
-
Notifications
You must be signed in to change notification settings - Fork 266
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
Konva is hijacking React context and not allowing other context providers #446
Comments
You will likely need to 'bridge' the context through the Konva Stage - more discussion and example here: #188 (comment) |
That makes sense thanks. can I suggest that this be documented? Konva doesn't throw any warnings when it overrides the normal context functionality, and it may make for some frustrating debugging situations. I'd be happy to put in a pull request for that. |
Sure. It will be very good to have documentation in the README. |
I'm getting the same issue with Redux Providers. Have to place a provider as a child of stage for its children to have have access. |
I have create a PR for adding info to the README: #450 - let me know if I missed anything |
Update on this issue. From |
When using Context in React, Konva apparently hijacks the context tree in a way that prevents an providers wrapping the stage from ever updating from their default values. In this Code Sandbox example you can see that according to the rules of context, the rectangle should render as red, even though the default value of the context is blue. Because the default is never overwritten, the rectangle renders as blue, even though a value of "red" is being passed to the context provider.
The text was updated successfully, but these errors were encountered: