@react-hookz/web
Version:
React hooks done right, for browser and SSR.
5 lines (4 loc) • 336 B
TypeScript
import { type MutableRefObject } from 'react';
export type HookableRefHandler<T> = (v: T) => T;
export declare function useHookableRef<T>(initialValue: T, onSet?: HookableRefHandler<T>, onGet?: HookableRefHandler<T>): MutableRefObject<T>;
export declare function useHookableRef<T = undefined>(): MutableRefObject<T | null | undefined>;