SolidJSS
SolidJSโ€ข3y agoโ€ข
3 replies
Neto

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>


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?
Was this page helpful?