-
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
React 18 implicit children typing issue? #1245
Comments
@girvo yesterday i found this, which could be related: https://www.reddit.com/r/reactjs/comments/u2rbbx/library_authors_should_revise_typings_to_support/ |
Mantine does not use FC type anywhere, so most likely provided codemod will not help. |
@rtivital Yeah I initially assumed it was something to do with that as well initially (you can tell in my initial paragraph thats what I thought it was) but then checked the source and saw that the FC type isn't used anywhere, and yet the type error still exists. Super odd. Is there anything I can do to help with tracking this down? It's unfortunately prevented us from migrating to v18 at work. Happy to do some more debugging or see if I can reproduce a tiny test case for it if need be, or post more of the source we have for it, but it's super weird. Basically thinks it's https://stackoverflow.com/questions/71852153/type-is-not-assignable-to-type-reactnode In a different context, someone else has run into this recently as well, but without much success in tracking down the issue it seems |
Are you sure? I ran the codemod (https://github.com/eps1lon/types-react-codemod) and quite a few changes were made: |
@girvo Have you tried adding React 17 to the resolutions of your package.json? "resolutions": {
"@types/react": "17.0.8"
} |
@wes337 While using |
I think so. I was just reading in that issue you linked, and many people found a solution using resolutions: facebook/react#24304 (comment). |
Also experiencing
With versions: "@types/react": "18.0.13",
"react": "18.2.0",
"react-dom": "18.2.0",
"@mantine/core": "^4.2.11", Not sure if that's related |
Fixed in 5.0 |
What package has an issue
@mantine/core
Describe the bug
So the
@types/react
typing package for TypeScript, for React 18, has remove the implicit children for all component types, and this is causing me to run into some issues with our extensions of some Mantine components.When used with React 18.0.1,
@types/react
18.0.1 and@mantine/core
v4.1.3, this gives an error about React.ReactNode not being React.ReactNode!At the
{props.header()}
line:I'm not entirely sure what is causing this, other than some kind of typing mismatch when trying to use React v18 and it's v18 @types package with Mantine?
In which browser did the problem occur
All browsers
If possible, please include a link to a codesandbox with the reproduced problem
No response
Do you know how to fix the issue
No response
Are you willing to participate in fixing this issue and create a pull request with the fix
No response
Possible fix
No response
The text was updated successfully, but these errors were encountered: