If using the new style context, re-declare this in your class to be the
React.ContextType of your static contextType.
Should be used with type annotation or static contextType.
StaticcontextIf set, this.context will be set at runtime to the current value of the given Context.
StaticdefaultCalled immediately after a component is mounted. Setting state here will trigger re-rendering.
Called when the component may be receiving new props. React may call this even if props have not changed, so be sure to compare new and existing props if you only want to handle changes.
Calling Component.setState generally does not trigger this method.
This method will not stop working in React 17.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps prevents this from being invoked.
Deprecated
See
React Docs