@supunlakmal/hooks
Version:
A collection of reusable React hooks
5 lines (4 loc) • 334 B
TypeScript
import { type MutableRefObject } from 'react';
export type HookableRefHandler<T> = (v: T) => T;
export declare function useHookableRef<T = undefined>(): MutableRefObject<T | null | undefined>;
export declare function useHookableRef<T>(initialValue: T, onSet: HookableRefHandler<T>, onGet: HookableRefHandler<T>): MutableRefObject<T>;