Context In Typescript
I'm trying to create a context in Typescript following this example, but copying and pasting the code results in an error when I try and use the
ThemeContext.Provider
in the ThemeProvider
Component.
https://www.solidjs.com/examples/context
Cannot find namespace 'ThemeContext'.
Any suggestions?SolidJS
Solid is a purely reactive library. It was designed from the ground up with a reactive core. It's influenced by reactive principles developed by previous libraries.
13 Replies
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
I can't replicate the error in the playground so it must be something with my configuration. Is there anyway to see what configuration the playground is using? I'm just using the default template from Solid JS without any major changes.
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
Sure. Anything else that would be helpful?
@futurelights can you reproduce it in the solid playground? makes it way easier for us to help troubleshoot
Solid Playground
Quickly discover what the solid compiler will generate from your JSX template
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
It works in the playground just fine, which is great, but doesn't help my problem. I've downloaded the project and it's fine in VSCode. I'm trying to make sure that everything lines up between my two projects.
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
It's
ts
lol. tsx
fixed it. ThanksUnknown User•2y ago
Message Not Public
Sign In & Join Server To View
Well at least it was an easy fix. Yeah. That was confusing. Thank you!
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View