@itwin/itwinui-react
Version:
A react component library for iTwinUI
13 lines (12 loc) • 414 B
TypeScript
/**
* Hook that "memoizes" a function by skipping reactivity, similar to `React.useEffectEvent`,
* except it returns a stable reference. Under the hood, it combines `useLatestRef` and `React.useCallback`.
*
* @private
*
* @example
* ```ts
* const onClick = useStableCallback(props.onClick);
* ```
*/
export declare function useStableCallback<T extends (...args: any) => any>(callback: T | undefined): T;