UNPKG

@itwin/core-react

Version:

A react component library of iTwin.js UI general purpose components

21 lines 1.08 kB
/** @packageDocumentation * @module Utilities */ import type { IDisposable } from "@itwin/core-bentley"; /** * A custom hook which creates a disposable object and manages its disposal on unmount * or factory method change. * @public * @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. */ export declare function useDisposable<TDisposable extends IDisposable>(createDisposable: () => TDisposable): TDisposable; /** * A custom hook which calls the factory method to create a disposable object * which might as well be undefined. If the result was a disposable object, the * hook takes care of disposing it when necessary. * @public * @deprecated in 4.15.0. Use `useState` + `useEffect` for creating and disposing disposable resources. */ export declare function useOptionalDisposable<TDisposable extends IDisposable>(createDisposable: () => TDisposable | undefined): TDisposable | undefined; //# sourceMappingURL=useDisposable.d.ts.map