realue • Docs
realue / useReferencedState
useReferencedState<
T
>(value
):ReferenceStateResult
<T
>
Same as useState
, but returns the value in a reference to use it in callbacks without having to regenerate them.
• T
• value: T
Initial value.
ReferenceStateResult
<T
>
A couple containing the reference to the current state value, and the state updater function.
lib/hooks/useReferencedState.ts:15
useReferencedState<
T
>():ReferenceStateResult
<T
|undefined
>
• T = undefined
ReferenceStateResult
<T
| undefined
>