-
Notifications
You must be signed in to change notification settings - Fork 47.2k
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 19 breaking with this.props.children #31832
Comments
Whatever is in I recommend removing as much code as possible from this Component tree until it no longer reproduces. That should help identifying the offending Component. |
check this might be useful for you
} |
@eps1lon The only child of the class is a paragraph element as of now, so no third party dependencies. The code screenshot above is part of an npm library that I am writing and trying to import into another project. Everything works works completely fine when I build my npm library with React 18 and I make the other project also use React 18 (or if both use React 19), but any mismatch between React versions causes stuff to break. |
Update: Even with no children, it breaks! |
I am also seeing this issue unfortunately. |
Do an If you see packages using 18, this is why it's happening, as there's a mistmatch between 19 and 18. I'd recommend looking into the effected packages and maybe helping them raise PR's to update their deps/peerDeps |
It sounds like this is a backwards compatibility issue - is there no intention to fix it? |
Hello,
Our code is now breaking when we upgrade to React 19. It seems related to this.props.children, and it works fine in React 18. I have attached the error and a screenshot of where the code is breaking.
[Error: Objects are not valid as a React child (found: object with keys {$$typeof, type, key, ref, props, _owner}). If you meant to render a collection of children, use an array instead.]
Error occurred prerendering page "/". Read more: https://nextjs.org/docs/messages/prerender-error
Error: Objects are not valid as a React child (found: object with keys {$$typeof, type, key, ref, props, _owner}). If you meant to render a collection of children, use an array instead.
The text was updated successfully, but these errors were encountered: