-
Notifications
You must be signed in to change notification settings - Fork 47.5k
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
[Bug] New Context API does not work with ReactDOM.unstable_renderSubtreeIntoContainer #12493
Comments
I don’t think we’ll implement new context API support for |
I see. Unfortunately there are some cool 3rd party components that still use it, like golden-layout. It's javascript (not React) component, but they have integration with react, which triggers each docking panel to rendering through react the following way:
Not sure how to migrate it to createPortal approach, since it's the javascript component who triggers the rendering of each docking react panel, not the parent react component. |
ag-grid-react has the same behavior and the same problem for cells |
Sorry. |
Do you want to request a feature or report a bug?
BUG
What is the current behavior?
Consumer rendered by invokes ReactDOM.unstable_renderSubtreeIntoContainer, invokes render function with DEFAULT context value ignoring value of Provider
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. Your bug will get fixed much faster if we can run your code and it doesn't have dependencies other than React. Paste the link to your JSFiddle (https://jsfiddle.net/Luktwrdm/) or CodeSandbox (https://codesandbox.io/s/new) example below:
Open example on Codesandbox.io
=>State should change to 1, and ChildComponent rendered directly will show it
=> ChildComponent rendered through unstable_renderSubtreeIntoContainer should show 1
Actual result: ChildComponent rendered through unstable_renderSubtreeIntoContainer should show 111 (which is default value specified in createContext)
What is the expected behavior?
unstable_renderSubtreeIntoContainer should pass context through to consumer
Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?
React: 16.3.0
Chrome: 65 x64
Windows: 10 x64
The text was updated successfully, but these errors were encountered: