Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ThemeProvider returns multiple types #279

Open
javi95z opened this issue Mar 22, 2024 · 3 comments
Open

ThemeProvider returns multiple types #279

javi95z opened this issue Mar 22, 2024 · 3 comments
Labels
needs information This issue is not actionable until more information is provided

Comments

@javi95z
Copy link

javi95z commented Mar 22, 2024

Type error: 'ThemeProvider' cannot be used as a JSX component. 
Its return type 'string | number | boolean | Iterable<ReactNode> | Element' is not a valid JSX element.
@TomTom-Labs
Copy link

For me, the problem was introduced: next-themes ^0.2.1 → ^0.3.0

Type error: 'ThemeProvider' cannot be used as a JSX component.
  Its return type 'string | number | boolean | Element | Iterable<ReactNode>' is not a valid JSX element.
    Type 'string' is not assignable to type 'ReactElement<any, any>'.

@trm217 trm217 added the needs information This issue is not actionable until more information is provided label Apr 23, 2024
@trm217
Copy link
Collaborator

trm217 commented Apr 23, 2024

@javi95z We need more information if we are to look into this. Can you please provide a reproduction?
(Context: I have ~10 Next.js Apps on v14 with next-themes v0.3 running without any such issues)

@vshakun
Copy link

vshakun commented May 3, 2024

Hello!

I have the same issue using

{
  "next-themes": "^0.3.0",
  "react": "^18.2.0", 
  "vite": "^5.2.8"
}

Downgrading next-themes to ^0.2.1 fixes the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs information This issue is not actionable until more information is provided
Projects
None yet
Development

No branches or pull requests

4 participants