Replies: 2 comments 1 reply
-
|
I guess you are likely trying to apply two class names on theme switch? That method expects one class only, so no whitespaces allowed. |
Beta Was this translation helpful? Give feedback.
1 reply
-
|
I'm going to get me coat. Dam local storage had another setting from previous projects that messed this up. My apologies. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
This could be just me (probably). I create a new app, install shadcn and follow the doc for the darkmode toggle. Soon as i add the ThemeProvider to the layout, I get this error
DOMTokenList.add: The token can not contain whitespace.
lib/providers/ThemeProvider.tsx (7:5) @ ThemeProvider
5 | export function ThemeProvider({ children }: { children: React.ReactNode }) {
6 | return (
Now in v16.0.4/5 I think, I did exactly the same thing but never had this error appear.
Is this a bug or does anybody else who just creates a new app and follow the doc for the shadcn toggle? I've tried it without any component package and still the same.
Additional information
Just to note that this error appears as soon as i wrap the next-themes provider around the root layout.
Example
No response
Beta Was this translation helpful? Give feedback.
All reactions