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

Parent context eliminated when a new child context is introduced. #156

Closed
tylerbwilliams opened this issue May 18, 2016 · 3 comments
Closed

Comments

@tylerbwilliams
Copy link

When a new component with a getChildContext method is introduced, it doesn't merge the new context with any existing parent context. This causes problems if context is set in multiple places.

Preact.js - Only uses latest childContext
https://github.com/developit/preact/blob/4de2fb9be5201b84f281d0f9d2fcef1017bedd11/src/vdom/component.js#L112

React.js - Assigns ( and shallow clones ) parent context with childContext
https://github.com/facebook/react/blob/378c879a6a65afe18acacb8e2a6fe6ea323974df/src/renderers/shared/stack/reconciler/ReactCompositeComponent.js#L664

@developit
Copy link
Member

Ahh good catch, I'll get a fix in for this ASAP.

@developit
Copy link
Member

I have a confirmed fix coming for this.

@developit
Copy link
Member

@tylerbwilliams I've released this under the beta tag: npm i -S preact@beta

marvinhagemeister added a commit that referenced this issue Mar 2, 2019
marvinhagemeister pushed a commit that referenced this issue Mar 15, 2022
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