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

JSX transform incompatible with React 19 #909

Open
pzaczkiewicz-athenahealth opened this issue Aug 31, 2024 · 3 comments
Open

JSX transform incompatible with React 19 #909

pzaczkiewicz-athenahealth opened this issue Aug 31, 2024 · 3 comments

Comments

@pzaczkiewicz-athenahealth

What is the current behavior?

JSX transform uses React.createElement, which is incompatible with React 19: https://react.dev/blog/2024/04/25/react-19-upgrade-guide#installing

This is somewhat premature, as React 19 isn't out of canary status yet, but component libraries should adapt prior to React 19 getting out of canary status.

What is the expected behavior?

Able to use with React 19

@Arkellys
Copy link

Arkellys commented Sep 1, 2024

I'm using the library with React 19 RC with no problem, do you get errors?

@pzaczkiewicz-athenahealth
Copy link
Author

No, I haven't tried using react-transition-group with React 19. I maintain a design system, which uses react-transition-group as a dependency. While reviewing the documented breaking changes for React 19, I came across the JSX transform deprecation. While I linked to the documentation, I'll repeat here:

New JSX Transform is now required
We introduced a new JSX transform in 2020 to improve bundle size and use JSX without importing React. In React 19, we’re adding additional improvements like using ref as a prop and JSX speed improvements that require the new transform.

If the new transform is not enabled, you will see this warning:

Your app (or one of its dependencies) is using an outdated JSX transform. Update to the modern JSX transform for faster performance: https://react.dev/link/new-jsx-transform
We expect most apps will not be affected since the transform is enabled in most environments already. For manual instructions on how to upgrade, please see the announcement post.

Reading between the lines, "Required" doesn't seem to mean "will be deleted from React" given that it's meant to generate a console error. I've inspected the build artefacts for react-transition-group and it's definitely using React.createElement in the latest version. Given that you've reported that React 19 RC doesn't report this console error, it seems that the documentation is ahead of the implementation. Maybe it won't actually be a console error when React 19 is finally released, but this signals that React.createElement will eventually be officially deprecated, and later removed.

That definitely makes this "issue" speculation, but it should also be a small change.

@Netail
Copy link

Netail commented Jan 3, 2025

The following started too:

Warning: Transition uses the legacy childContextTypes API which is no longer supported and will be removed in the next major release. Use React.createContext() instead

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants