solid-docs icon indicating copy to clipboard operation
solid-docs copied to clipboard

The children utility function causes the child components to initialize in advance.

Open siaikin opened this issue 2 years ago • 3 comments

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

  1. Go to https://playground.solidjs.com/anonymous/29fa1b7c-efd7-4f32-a6f7-1a37c22b047c
  2. Button render -1, this is initialValue.
  3. Please comment out this IS NOT WORK code, 16-19 lines.
  4. Than comment in IS WORK code, 22-24 lines.
  5. 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

siaikin avatar Nov 03 '23 09:11 siaikin

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.

CBID2 avatar Jul 21 '23 18:07 CBID2

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.

darrenbarklie avatar Jul 22 '23 11:07 darrenbarklie

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 😉

LadyBluenotes avatar Jul 22 '23 14:07 LadyBluenotes

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! :)

CBID2 avatar Jul 22 '23 14:07 CBID2

Closed with #290

LadyBluenotes avatar Aug 12 '23 04:08 LadyBluenotes