-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
@types/react
installation mismatch
#7227
Comments
After update to React 19: This is also happening in Vite (SPA), even with MenuTarget (no Menu.Target) Only in that component 'MenuTarget' cannot be used as a JSX component.
Its type 'ForwardRefExoticComponent<MenuTargetProps & RefAttributes<HTMLElement>>' is not a valid JSX element type.
Type 'ForwardRefExoticComponent<MenuTargetProps & RefAttributes<HTMLElement>>' is not assignable to type '(props: any) => ReactNode'.
Type 'import(".../node_modules/@mantine/core/node_modules/@types/react/index").ReactNode' is not assignable to type 'React.ReactNode'.
Type 'ReactElement<any, string | JSXElementConstructor<any>>' is not assignable to type 'ReactNode'.
Property 'children' is missing in type 'ReactElement<any, string | JSXElementConstructor<any>>' but required in type 'ReactPortal'.ts(2786) |
Okay, this is a ts issue, probably with |
I just tried with Edit: also not a problem with Here is the sandbox with https://codesandbox.io/p/github/kenzaflow/vite-template/master?import=true |
Try adding resolutions to your package.json and reinstall dependencies: "resolutions": {
"@types/react": "19.0.1",
"@types/react-dom": "19.0.1"
} |
I installed only nextjs and mantine. I encountered the same problem in codesandbox.io. Then I installed it with yarn and built it and it worked without any problems. |
Setting the resolutions to the suggested versions in yarn resolved my issue. |
This solution works. (it should match versions installed) "overrides": {
"@types/react": "19.0.1",
"@types/react-dom": "19.0.1"
} |
The issue is not related to Mantine. If you see this message, it means that there are two conflicting versions of
"resolutions": {
"@types/react": "19.0.1",
"@types/react-dom": "19.0.1"
}
"overrides": {
"@types/react": "19.0.1",
"@types/react-dom": "19.0.1"
} |
@types/react
installation mismatch
Dependencies check up
What version of @mantine/* packages do you have in package.json?
7.14.3
What package has an issue?
@mantine/core
What framework do you use?
Next.js
In which browsers you can reproduce the issue?
Not applicable – issue is not related to the browser
Describe the bug
I'm currently building a menu component and came across this exception why trying to build (TS):
This is my example implementation which I could reproduce the issue:
package.json file:
If possible, include a link to a codesandbox with a minimal reproduction
No response
Possible fix
No response
Self-service
The text was updated successfully, but these errors were encountered: