useDisposable Function
Deprecated in 4.9.0. This hook is not compatible with React 18 Strict mode. Use useOptionalDisposable or useState
+ useEffect
for
creating and disposing disposable resources.
A custom hook which creates a disposable object and manages its disposal on unmount or factory method change.
useDisposable<TDisposable extends IDisposable>(createDisposable: () => TDisposable): TDisposable
Parameter | Type | Description |
---|---|---|
createDisposable | () => TDisposable |
Returns - TDisposable
Defined in
Last Updated: 14 November, 2024
Found something wrong, missing, or unclear on this page?Raise an issue in our repo.