React Docs
Called immediately after a component is mounted. Setting state here will trigger re-rendering.
Called immediately after updating occurs. Not called for the initial render.
The snapshot is only present if getSnapshotBeforeUpdate is present and returns non-null.
Deprecated
See
React Docs