-
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] - ReactElement
created from React.createElement
are not renderable anymore
#31012
Comments
You probably have different versions of React installed. Or a 3rd party library is bundling the JSX runtime of a different React version. The repro is too big for us to check out. Can you trim it down to something minimal? |
I don't know. Since it is using Next.js Pages Router, Next.js would most likely not use its bundled version of React.
No, we do not use any CSS-in-JS that requires non-React jsx runtime. It uses style9, a similar AoT CSS-in-JS approach to Facebook's
Lemme give it a shot! |
Update I know what happened and it is not an issue of React. So the serialization assumes the Years later, the coming React 19 is introducing new shapes of react element (#28813), and therefore objects with Also, because the original |
Summary
TL; DR
Using
React.createElement
in theJSON.parse
's revive function to deserialize json intoReactElement
, but the returned value can no longer be rendered with errors:I am maintaining a docs site powered by React & Next.js Pages Router.
The docs site copy-pastes a risk approach of rendering MDX on the server serializing MDX components on the server and deserializing on the client from the React docs site:
https://github.com/reactjs/react.dev/blob/39abc60fce1588b4e83cc45d52b522aa63c01bc2/src/utils/compileMDX.ts#L145C1-L160C4
https://github.com/reactjs/react.dev/blob/39abc60fce1588b4e83cc45d52b522aa63c01bc2/src/pages/%5B%5B...markdownPath%5D%5D.js#L104-L128
I have slightly modified the
reviveNodeOnClient
function to useReact.createElement
instead:Yet, I get this error:
Reproduction
Repo
SukkaW/mirrorz-help
with branchhousekeeping
.https://github.com/SukkaW/mirrorz-help/tree/housekeeping
The text was updated successfully, but these errors were encountered: