This repository has been archived by the owner on Sep 17, 2024. It is now read-only.
The children utility function causes the child components to initialize in advance. #279
Labels
documentation
Improvements or additions to documentation
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 theinitialValue
ofcreateContext
throughuseContext
, 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 WORK
code, 16-19 lines.IS WORK
code, 22-24 lines.-2
, this is provide byContext.Provider
.Expected behavior
I hope that when using the
children
utility function, the child components will not be initialized in advance, causinguseContext
to be unable to get the provided value.Screenshots or Videos
No response
Platform
Additional context
No response
The text was updated successfully, but these errors were encountered: