React Context not available in components
See original GitHub issueHey Dennis! Sorry for this neverending story, but I have another problem using the jsx/webpack adapter. 😕
Describe the bug We have a use case where we need data available to every component. To avoid “prop drilling” we want to make use of the Context-API for this.
I tried to make use of the react-server-render
and react-client-render
for this to make the context available to every component/variant in UIEngine.
This looked good at first, since the Context-Provider showed up in the component tree:
Unfortunately, the actual context is not accessible in the components of the UIEngine. It appears like the context is not passed through to all the underlying components.
To Reproduce Steps to reproduce the behavior:
- A minimal example of the problem can be found here: https://github.com/MrAvantiC/uiengine-context
- Install dependencies and start development server
- See the console-ouput of the
render()
method in<Footer />
Expected behavior
The context should be available in the <Footer />
component.
I can confirm that the same code works in CRA/Next.js.
Kind regards, René
Issue Analytics
- State:
- Created 4 years ago
- Comments:15 (10 by maintainers)
Status update: I got it working now 😃
Will clean up the code and test whether or not this helps with the hooks issue as well during the next days.
v2.5 is available now and fixes this 😃