Experiments on new features on the react
React | Mounting(绑定) | Updating(数据更新) | Unmounting (解除绑定) | Error Handling (错误处理) |
---|---|---|---|---|
V 16.0.0 | constructor() componentWillMount() render() componentDidMount() |
componentWillReceiveProps() shouldComponentUpdate() componentWillUpdate() render() componentDidUpdate() |
componentWillUnmount() | componentDidCatch() |
V 16.3.2 | constructor() static getDerivedStateFromProps() componentWillMount() / UNSAFE_componentWillMount() render() componentDidMount() |
componentWillReceiveProps() / UNSAFE_componentWillReceiveProps() static getDerivedStateFromProps() shouldComponentUpdate() componentWillUpdate() /UNSAFE_componentWillUpdate() render() getSnapshotBeforeUpdate() componentDidUpdate() |
componentWillUnmount() | componentDidCatch() |
V 16.5.2 | constructor() static getDerivedStateFromProps() render() componentDidMount() |
static getDerivedStateFromProps() shouldComponentUpdate() render() getSnapshotBeforeUpdate() componentDidUpdate() |
componentWillUnmount() | componentDidCatch() |
V 16.7.0(最新) | constructor() static getDerivedStateFromProps() render() componentDidMount() |
static getDerivedStateFromProps() shouldComponentUpdate() render() getSnapshotBeforeUpdate() componentDidUpdate() |
componentWillUnmount() | static getDerivedStateFromError() componentDidCatch() |