Market Insight. 11 Dec 2017

What’s new in React 16 JavaScript UI library

React 16, the latest version of the popular JavaScript library for building UIs, got its Version 16.2 update  this week. It features a fragments capability to improve support for showing multiple children from a component render method. Fragments, which resemble empty JSX tags, let developers group a list of children without adding nodes to the DOM. You can install Version 16.2 from the NPM registry. To install with the Yarn package manager, run yarn add react@^16.2.0 react-dom@^16.2.0. To install it with NPM, run npm install --save react@^16.2.0 react-dom@^16.2.0.

Dubbed “React Fiber” during its development, React 16 is a rewrite of the React core, improving perceived responsiveness for complex applications  via a new reconciliation algorithm. The initial version of React 16 debuted on September 26, 2017.

Key features of the React 16 include:

Promised for a later version of React 16 is asynchronous rendering, enabling processing of large components  without blocking the main execution thread. The first version of React 16 released today focuses on compatibility with existing apps, and so does not include the async capabilities.

Although React’s internals have been completely rewritten in React 16, the public API is “essentially unchanged,” said Sophie Alpert, Facebook’s engineering  manager for React. The intent was to save developers from having to rewrite existing components built with React.

React 16’s new code was written alongside old code in the GitHub repo, as per a familiar practice at Facebook. Switches between the two were done with the Boolean useFiber feature flag. The process let Facebook start building its new implementation without affecting existing users and continue to make bug fixes to the old code base.

After a few months of ironing out bugs, Facebook opted to deliver a single product to reduce the possible set of bugs, rather than keep two versions of React current.


What’s new in React 16 JavaScript UI library