react-elegant-ui
Version:
Elegant UI components, made by BEM best practices for react
12 lines (11 loc) • 531 B
TypeScript
/// <reference types="react" />
/**
* Create `RefObject` and `RefCallback` which update `RefObject`
*
* This different from `useState` because will not update state
* while set same object and this return always same `RefObject`
*
* It better than `RefCallback` for some cases, cuz you can
* handle updates but also have access to `RefObject`
*/
export declare function useLiveRef<T extends unknown = undefined>(initialValue?: T | null): readonly [import("react").MutableRefObject<T | null>, (instance: T | null) => void];