Skip to content

Latest commit

 

History

History
49 lines (25 loc) · 1.09 KB

useReferencedState.md

File metadata and controls

49 lines (25 loc) · 1.09 KB

realueDocs


realue / useReferencedState

Function: useReferencedState()

useReferencedState(value)

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.

Type Parameters

T

Parameters

value: T

Initial value.

Returns

ReferenceStateResult<T>

A couple containing the reference to the current state value, and the state updater function.

Defined in

lib/hooks/useReferencedState.ts:15

useReferencedState()

useReferencedState<T>(): ReferenceStateResult<T | undefined>

Type Parameters

T = undefined

Returns

ReferenceStateResult<T | undefined>

Defined in

lib/hooks/useReferencedState.ts:16