Neto
Neto
Explore posts from servers
SSolidJS
Created by Neto on 1/21/2023 in #support
Context hierarchy
I was using the create context and such, and found a weird behaviour that even with a context hierarchy still using default values
<CounterProvider> // context provider is here
<App/> // counter is here but still using default behaviour
</ContextProvider>
<CounterProvider> // context provider is here
<App/> // counter is here but still using default behaviour
</ContextProvider>
Especially with the quote from the docs Default Context is used when no Provider is found above in the hierarchy. Stackblitz with example https://stackblitz.com/edit/solidjs-templates-zeprsr?file=src%2Findex.tsx,src%2Flib%2FCounterProvider.tsx,src%2FApp.tsx And there a bug or im missing something?
4 replies