Paul Krill
Editor at Large

React 17 makes upgrades easier

news
Oct 22, 20202 mins

Support for gradual updates in React 17 should make it safer to mix different versions of React in the same app

React - an open-source JavaScript library for building user interfaces
Credit: Thinkstock

React 17, the latest version of the JavaScript UI library from Facebook, has arrived. The new release, designed to serve as a stepping stone, lacks any new developer-facing features but instead focuses on making upgrades easier.

Unveiled October 20, React 17 enables gradual React upgrades. When moving from React 15 to React 16 or from React 16 to React 17, users usually would upgrade the entire app at once. While this works well for many apps, it can be challenging if the codebase was written more than a few years ago and was not actively maintained.

Although it is possible to use two versions of React on the same web page, this has been fragile and has caused problems with events. Many of these problems are being fixed with React 17. Thus, when React 18 and subsequent versions are published, developers will be able to upgrade an app either all at once or piece by piece.

With React 17, it becomes safer to embed a tree managed by one version of React into a different version of the library. React 17 also makes it easier to embed React into apps that were built with other technologies.

To enable gradual updates, changes have been made to the React event system; these changes are potentially breaking. A FAQ has been published pertaining to stability.

In addition, React 17 introduces support for a new JSX transform, and that support is backported to older versions of React as well. The new transform is offered on an opt-in basis.

To install React 17 from NPM, you can use the following command:

npm install react@17.0.0 react-dom@17.0.0

From Yarn, use:

yarn add react@17.0.0 react-dom@17.0.0

Paul Krill

Paul Krill is editor at large at InfoWorld. Paul has been covering computer technology as a news and feature reporter for more than 35 years, including 30 years at InfoWorld. He has specialized in coverage of software development tools and technologies since the 1990s, and he continues to lead InfoWorld’s news coverage of software development platforms including Java and .NET and programming languages including JavaScript, TypeScript, PHP, Python, Ruby, Rust, and Go. Long trusted as a reporter who prioritizes accuracy, integrity, and the best interests of readers, Paul is sought out by technology companies and industry organizations who want to reach InfoWorld’s audience of software developers and other information technology professionals. Paul has won a “Best Technology News Coverage” award from IDG.

More from this author