[FIXED] useContext returning default value even though Provider is set up properly according to docs

These are my project's files, I'm trying to make an I18nProvider on my own since I couldn't find any I18n library that fits my needs. However, even though everything in the code is simple and follows the docs (https://docs.solidjs.com/concepts/context), my console.log at index.tsx always prints the default value (None)
5 Replies
Cupertino
CupertinoOP2mo ago
Cupertino
CupertinoOP2mo ago
forgot to include my app.tsx
Madaxen86
Madaxen862mo ago
Don’t destructure props e.g. children in I18n provider component
Cupertino
CupertinoOP2mo ago
doesn't the docs say that i should put children inside the provider component?
No description
Cupertino
CupertinoOP2mo ago
ohhh, sorry, i get what you meant now thank you! it fixed the issue

Did you find this page helpful?