Skip to content
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

useContext returns invalid/default value when used inside custom react renderer #14101

Closed
HriBB opened this issue Nov 5, 2018 · 1 comment
Closed

Comments

@HriBB
Copy link

HriBB commented Nov 5, 2018

Do you want to request a feature or report a bug?

I want to request a bug.

What is the current behavior?

If we useContext inside Component in a custom renderer tree, the default value (value passed to React.createContext function) is returned.

What is the expected behavior?

Expected behavior is to get the latest value of the context.

Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?

react: 16.7.0-alpha.0
react-dom: 16.7.0-alpha.0
react-reconciler: 0.17.0-alpha.0
scheduler: 0.11.0-alpha.0

Here's a reproduction case https://github.com/HriBB/react-repro. Already filed related bug to react-devtools issue tracker.

@gaearon
Copy link
Collaborator

gaearon commented Nov 5, 2018

This is an expected limitation. See #13336 (comment) for a workaround.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants