This repository was archived by the owner on Sep 17, 2024. It is now read-only.

Description
Describe the bug
I use Context to inject some data globally, and I optimize the access to children according to the examples given in the tutorial, that is, using the children utility function to wrap props.children. However, the child components always access the initialValue of createContext through useContext, instead of the data I provide through Provider.
Your Example Website or App
https://playground.solidjs.com/anonymous/29fa1b7c-efd7-4f32-a6f7-1a37c22b047c
Steps to Reproduce the Bug or Issue
- Go to https://playground.solidjs.com/anonymous/29fa1b7c-efd7-4f32-a6f7-1a37c22b047c
- Button render
-1, this is initialValue.
- Please comment out this
IS NOT WORK code, 16-19 lines.
- Than comment in
IS WORK code, 22-24 lines.
- Butten Render
-2, this is provide by Context.Provider.
Expected behavior
I hope that when using the children utility function, the child components will not be initialized in advance, causing useContext to be unable to get the provided value.
Screenshots or Videos
No response
Platform
- OS: Windows
- Browser: Chrome
Additional context
No response