Description
Do you want to request a feature or report a bug?
Quite possibly a bug (or maybe confusion about the current API)
I am using the new Context API as well as the new static contextType
in React 16.6. I am passing context down a couple components deep but when I attempt to access the context within the component, the object is empty (only the default value passed into ). This is happening in a current feature I am working on at my job, so I cannot display that code, but I did create a Codesandbox with the gist of the problem.createContext
is being displayed
Here is a demonstration of the behavior: https://codesandbox.io/s/r4myz959ro
I would expect to be able to access the current values of the context. This way, if those values change, I would always have the most recent values. Now, maybe this is expected behavior, however, it would be confusing if it is.
React 16.6
ReactDOM 16.6