@navikt/ds-react
Version:
React components from the Norwegian Labour and Welfare Administration.
7 lines (6 loc) • 412 B
TypeScript
/**
* A custom hook that converts a callback to a ref to avoid triggering re-renders when passed as a
* prop or avoid re-executing effects when passed as a dependency
* https://github.com/radix-ui/primitives/blob/main/packages/react/use-callback-ref/src/useCallbackRef.tsx
*/
export declare function useCallbackRef<T extends (...args: any[]) => any>(callback: T | undefined, deps?: React.DependencyList): T;