Allows subclasses to push things to this._disposables to be auto disposed.
Gets the event group instance assocaited with the component, created on demand. The event instance provides on/off methods for listening to DOM (or regular javascript object) events. The event callbacks will be automatically disconnected after unmounting. The helpers within the events object also preserve the this reference so that you don't need to "bind" the callbacks.
Controls whether the componentRef prop will be resolved by this component instance. If you are implementing a passthrough (higher-order component), you would set this to false and pass through the props to the inner component, allowing it to resolve the componentRef.
Gets the object's class name.
Called immediately before mounting occurs, and before Component#render
.
Avoid introducing any side-effects or subscriptions in this method.
This method will not stop working in React 17.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps prevents this from being invoked.
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.
Called immediately before rendering when new props or state is received. Not called for the initial render.
Note: You cannot call Component#setState
here.
This method will not stop working in React 17.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps prevents this from being invoked.
Helper to return a memoized ref resolver function.
Name of the member to assign the ref to.
A function instance keyed from the given refname.
Updates the componentRef (by calling it with "this" when necessary.)
Warns when props are required if a condition is met.
The name of the props that are required when the condition is met.
The name of the prop that the condition is based on.
Whether the condition is met.
Warns when a deprecated props are being used.
The map of deprecations, where key is the prop name and the value is either null or a replacement prop name.
Warns when props which are mutually exclusive with each other are both used.
The map of mutually exclusive props.
Catches exceptions generated in descendant components. Unhandled exceptions will cause the entire component tree to unmount.
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 mounting occurs, and before Component#render
.
Avoid introducing any side-effects or subscriptions in this method.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps prevents this from being invoked.
Runs before React applies the result of render
to the document, and
returns an object to be given to componentDidUpdate. Useful for saving
things such as scroll position before render
causes changes to it.
Note: the presence of getSnapshotBeforeUpdate prevents any of the deprecated lifecycle events from running.
Called to determine whether the change in props and state should trigger a re-render.
Component
always returns true.
PureComponent
implements a shallow comparison on props and state and returns true if any
props or states have changed.
If false is returned, Component#render
, componentWillUpdate
and componentDidUpdate
will not be called.
Generated using TypeDoc
Gets the async instance associated with the component, created on demand. The async instance gives subclasses a way to execute setTimeout/setInterval async calls safely, where the callbacks will be cleared/ignored automatically after unmounting. The helpers within the async object also preserve the this pointer so that you don't need to "bind" the callbacks.