-
Notifications
You must be signed in to change notification settings - Fork 47.2k
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
context does not update using unstable_renderSubtreeIntoContainer
#6599
Comments
Is it possible that you have a Alternatively this may be a new issue. Can you provide a JSFiddle reproducing it? |
Here's a minimal fiddle illustrating the issue: no shouldComponentUpdate here, just plain context passing. The context is not updated when |
Can you submit a PR with a failing test case please? |
You can find the PR here: #6924 It's my first PR to react. So I hope, I didn't miss anything obvious! 😰 |
Is it safe to use |
@iotch -- a little insight from this tweet https://twitter.com/soprano/status/737316379712331776 |
I can confirm that context does not update when using |
* create failing test case * Fix renderSubtreeIntoContainer to update context Fixes #6599 * Also test re-rendering due to prop update * Address review feedback
I use
ReactDOM.unstable_renderSubtreeIntoContainer
to render a portal.In my root component:
The context of root component will be updated and passed to children if
this.props.highlightColor
is changed. This is right.I can access the correct context in the
<ModalPortal/>
component in the first render.And after that the context passed to
<ModalPortal/>
does not change any more when the context of root component changed.But I can access the correct context in the
<Modal/>
every render.what's wrong with my code ?
The text was updated successfully, but these errors were encountered: