The children utility function causes the child components to initialize in advance.
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 isinitialValue. - Please comment out this
IS NOT WORKcode, 16-19 lines. - Than comment in
IS WORKcode, 22-24 lines. - Butten Render
-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, causing useContext to be unable to get the provided value.
Screenshots or Videos
No response
Platform
- OS: Windows
- Browser: Chrome
Additional context
No response
Hi @LadyBluenotes! :) I think it would be beneficial to have a suggestion on reviewing PRs. It would be an awesome way for people who are new to contributing to Solid JS can have a way to start.
Hey @LadyBluenotes, I'm keen to support this new, new docs effort! I'm a practiced React dev, but relatively new to Solid and open source. As @CBID2 suggested, I'd appreciate defining/understanding the intended workflow for collaboration and PR submissions.
Hello to both @CBID2 and @darrenbarklie.
Everything with the docs effort is still quite new and can evolve. I'm working towards refining the process of how roles will be defined. I appreciate both of your interests in working with Solidn
As far as reviewing PRs go, we've got an existing plan for this for the rewrite. Unfortunately an existing understanding of knowledge is required for this.
We will have "help-wanted" labels on parts of the project that we need help on, so if you'd like to assist in any way watching that would be a great idea 🙂
I will add things we need help with in the #docs channel of the discord! So that's another great place to follow if you want to get involved 😉
Hello to both @CBID2 and @darrenbarklie.
Everything with the docs effort is still quite new and can evolve. I'm working towards refining the process of how roles will be defined. I appreciate both of your interests in working with Solidn
As far as reviewing PRs go, we've got an existing plan for this for the rewrite. Unfortunately an existing understanding of knowledge is required for this.
We will have "help-wanted" labels on parts of the project that we need help on, so if you'd like to assist in any way watching that would be a great idea 🙂
I will add things we need help with in the #docs channel of the discord! So that's another great place to follow if you want to get involved 😉
Great! :)
Closed with #290