You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 17, 2024. It is now read-only.
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.
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.
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 theinitialValueofcreateContextthroughuseContext, 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
-1, this isinitialValue.IS NOT WORKcode, 16-19 lines.IS WORKcode, 22-24 lines.-2, this is provide byContext.Provider.Expected behavior
I hope that when using the
childrenutility function, the child components will not be initialized in advance, causinguseContextto be unable to get the provided value.Screenshots or Videos
No response
Platform
Additional context
No response