React 16.3.0 已发布,React 是 Facebook 推出的一个为数据提供渲染为 HTML 视图,用来构建用户界面的开源 JavaScript 库。
React 视图通常采用包含以自定义 HTML 标记规定的其他组件的组件渲染。React 为程序员提供了一种子组件不能直接影响外层组件("data flows down")的模型,数据改变时对 HTML 文档的有效更新,和现代单页应用中组件之间干净的分离。
更新内容:
React.createRef()
API as an ergonomic alternative to callback refs.React.forwardRef()
API to let components forward their refs to a child. React.Fragment
React.unstable_AsyncComponent
with React.unstable_AsyncMode
setState()
on an unmounted component.getDerivedStateFromProps()
lifecycle and UNSAFE_
aliases for the legacy lifecycles. getSnapshotBeforeUpdate()
lifecycle<React.StrictMode>
wrapper to help prepare apps for async rendering. onLoad
and onError
events on the <link>
tagnoModule
boolean attribute on the <script>
tagonKeyPress
in more browsersvalue
and defaultValue
to ignore Symbol valuesopera
with a null
value<option selected>
ReactDOM.unstable_createPortal()
in favor of ReactDOM.createPortal()
. React.Component
. this.state
of different components getting mixed up.toTree()
. null
for components that don't set it. contextTypes
. ReactIs.isValidElementType()
to help higher-order components validate their inputs. react-reconciler/persistent
for building renderers that use persistent data structures. finalizeInitialChildren()
.useSyncScheduling
from the host config.