Error with ThemeProvider from next-themes
Unanswered
Ocicat posted this in #help-forum
OcicatOP
Hello, I'm using the latest version of nextjs with typescript and tailwindcss, I'm trying to implement a light/dark mode to my project but I get an error in the “providers.tsx”. The import is done correctly but it has trouble with the {children}, I think it's a typing error with typescript or JSX.
Anyone knows the solution ? Thanks in advance
providers.tsx and layout.tsx in media ->
Anyone knows the solution ? Thanks in advance
providers.tsx and layout.tsx in media ->
5 Replies
@Ocicat Hello, I'm using the latest version of nextjs with typescript and tailwindcss, I'm trying to implement a light/dark mode to my project but I get an error in the “providers.tsx”. The import is done correctly but it has trouble with the {children}, I think it's a typing error with typescript or JSX.
Anyone knows the solution ? Thanks in advance
providers.tsx and layout.tsx in media ->
Put your provider inside your body. Also share the full error that you have
Australian Freshwater Crocodile
Weird, I also have the latest Next.js version (also latest on TailwindCSS and next-themes) and i tried with your code and it works
Unless you're talking about latest canary version, i have the latest stable: v.15.1.5