-
Notifications
You must be signed in to change notification settings - Fork 49.3k
Closed
Labels
Description
Do you want to request a feature or report a bug?
- Report a bug
What is the current behavior?
- Each time a child component of
Context.Consumer
callssetState
, its parentContext.Consumer
re-renders.
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:
What is the expected behavior?
- Presumably the expected behavior is one where setting the state of a child component does not affect any parent
Context.Consumer
components, particularly when that state does not change
Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?
- Versions
- 16.3.0-alpha.1
- 16.3.0-alpha.0
- Browser
- Chrome (OSX 10.13.3) 64.0.3282.140
- This works as expected when the previous context API is used
camatangelo and ptoussai