勇哥

勇哥开发之路

I build things on web.

It is not recommended to use React 19 right now.

📢Breaking News#

React 19 was officially released on 2024.12.05.
Various media outlets rushed to publish the news, making it hard for those interested in front-end development to miss it.
Yong Ge won't elaborate further; interested readers can check out the official announcement from React or the second-hand coverage from various media outlets, which can easily be found online.

Personal Advice#

However, Yong Ge suggests: do not use React 19 in company projects just yet; you can play around with it yourself and try out the new features.

Why? In a nutshell: the ecosystem does not support it yet.

You can be bold with React 19, but a bunch of new features may not support old ones, leaving the downstream ecosystem in a tough spot.

If you upgrade a project that was running fine to React 19, build it, and ESLint throws various errors at you, with many features no longer supported, you might spend an entire afternoon solving issues, working late until 8 PM, only to revert back to React 18. You’ll learn your lesson the hard way.

Well, breaking news, breaking change!

🙋‍♀️Here's an Example🌰#

Some may not believe it, so Yong Ge will give you a few examples🌰:

Ant Design is quite popular, and because it heavily uses forwardRef, in React 19, ref is no longer used as props with forwardRef (it will be removed in the future). Ant Design officially informs you that it is currently not compatible with React 19.

What? Is your current project using Ant Design? You should stick with React 18.3 for now. Let's revisit this in a few months when Ant Design supports React 19.

Now, let’s mention another one. Framer Motion, the best animation library for React, has recently been renamed to Motion. After upgrading to React 19, if you build and encounter a bunch of errors, such as “className cannot be used in motion.div,” who are you going to talk to about it?

Final Thoughts#

The wheels of history roll forward and never stop for anyone. The development of a technology or framework never stagnates due to factors outside of itself. Those of us who rely on technology for our livelihood should actively embrace new technologies, but there’s no need to be the first to take the plunge; it’s perfectly fine to wait until the tools are ready before diving in.

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.