React 16, the latest version of Facebook’s popular JavaScript library for building UIs, was updated in late October 2018 to Version 16.6.
Where to download React
You can download React 16 from the project’s GitHub page.
Current version: What’s new in React 16.6
React 16.6 provides several enhancements.
- With
memo
, developers can bail out from rendering with function components, similar to how class components can bail from rendering when input props are the same usingPureComponents
orshouldComponentUpdate
. - With
lazy
, developers can use theSuspense
component for code-splitting by wrapping a dynamic import in call toReact.lazy()
. Note: The feature is not yet available for server-side rendering. - The convenience API was introduced to consume a context value from within a class component. Developers had complained that adopting the new render prop API from React 16.3 could be difficult in class components.
- An error method,
getDerivedStatefromError()
, renders the fallback UI before a render completes. Note: It is not yet available for server-side rendering, but developers can start to prepare for it. - Two
Strictmode
APIs have been deprecated:findDOMNode()
and legacy context usingcontextType
andgetChildContext
. Developers are encouraged to upgrade to the newcontextType
API.