Static
contextIf set, this.context
will be set at runtime to the current value of the given Context.
Static
defaultCalled 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.
Called immediately before a component is destroyed. Perform any necessary cleanup in this method, such as
cancelled network requests, or cleaning up any DOM elements created in componentDidMount
.
If using React Context, re-declare this in your class to be the
React.ContextType
of yourstatic contextType
. Should be used with type annotation or static contextType.