componentWillUpdate method

void componentWillUpdate(
  1. Map nextProps,
  2. Map nextState
)
inherited

ReactJS lifecycle method that is invoked immediately before rendering when nextProps or nextState are being received.

This method is not called for the initial render.

Use this as an opportunity to perform preparation before an update occurs.

Note: Choose either this method or componentWillUpdateWithContext. They are both called at the same time so using both provides no added benefit.

See: reactjs.org/docs/react-component.html#updating-componentwillupdate

UNSUPPORTED IN COMPONENT2

Due to the release of getSnapshotBeforeUpdate in ReactJS 16, componentWillUpdate is no longer the method used to check the state and props before a re-render. Both the Component class and componentWillUpdate will be removed alongside Component. Use Component2 and Component2.getSnapshotBeforeUpdate instead.

This will be completely removed alongside the Component class.

Implementation

void componentWillUpdate(Map nextProps, Map nextState) {}