10 lines
470 B
TypeScript
10 lines
470 B
TypeScript
import * as React from 'react';
|
|
/**
|
|
* A React.useRef() that is initialized with a function. Note that it accepts an optional
|
|
* initialization argument, so the initialization function doesn't need to be an inline closure.
|
|
*
|
|
* @usage
|
|
* const ref = useRefWithInit(sortColumns, columns)
|
|
*/
|
|
export declare function useRefWithInit<T>(init: () => T): React.RefObject<T>;
|
|
export declare function useRefWithInit<T, U>(init: (arg: U) => T, initArg: U): React.RefObject<T>; |