You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This method is invoked after a component is constructed. Return an object to initialize component state. Note that the value of `prevState` may be null in this case if the constructor did not initialize `this.state`.
365
+
This method is invoked after a component is instantiated and when it receives new props. Return an object to update state in response to prop changes. Return null to indicate no change to state.
365
366
366
-
This method is also invoked before a mounted component receives new props. Return an object to update state in response to prop changes. Return null to indicate no change to state.
367
+
If an object is returned, its keys will be merged into the existing state.
367
368
368
369
Note that React may call this method even if the props have not changed. If calculating derived data is expensive, compare next and previous props to conditionally handle changes.
This method will log a deprecation warning in development mode recommending that users use `componentDidMount` instead (when possible) or rename to `UNSAFE_componentWillMount`.
375
+
This method is deprecated and will be removed in the next major version. Read about the motivations behind this change at [fb.me/react-async-component-lifecycle-hooks](https://fb.me/react-async-component-lifecycle-hooks)
375
376
376
-
`componentWillMount` will be removed entirely in version 17.
377
+
As a temporary workaround, you can rename to `UNSAFE_componentWillMount` instead.
This method will log a deprecation warning in development mode recommending that users use `componentDidUpdate` instead (when possible) or rename to `UNSAFE_componentWillUpdate`.
381
+
This method is deprecated and will be removed in the next major version. Read about the motivations behind this change at [fb.me/react-async-component-lifecycle-hooks](https://fb.me/react-async-component-lifecycle-hooks)
381
382
382
-
`componentWillUpdate` will be removed entirely in version 17.
383
+
As a temporary workaround, you can rename to `UNSAFE_componentWillUpdate` instead.
This method will log a deprecation warning in development mode recommending that users use the new static `getDerivedStateFromProps` method instead (when possible) or rename to `UNSAFE_componentWillReceiveProps`.
387
+
This method is deprecated and will be removed in the next major version. Use `static getDerivedStateFromProps()`instead. Read about the motivations behind this change at [fb.me/react-async-component-lifecycle-hooks](https://fb.me/react-async-component-lifecycle-hooks)
387
388
388
-
`componentWillReceiveProps` will be removed entirely in version 17.
389
+
As a temporary workaround, you can rename to `UNSAFE_componentWillReceiveProps` instead.
0 commit comments