Skip to content

useRefState ​

Hook that returns the state reference of the value

utilities
test coverage
Last changed: last month

Installation ​

Library
CLI
Manual
typescript
import { useRefState } from '@siberiacancode/reactuse';

Usage ​

typescript
const internalRefState = useRefState();

Demo ​

Api ​

Parameters

NameTypeDefaultNote
initialValue?Value-The initial value

Returns

StateRef<Value>

Type declaration ​

typescript
export interface StateRef<Value> {
  (node: Value): void;
  current: Value;
  state?: Value;
}

Source ​

Source • Demo

Contributors ​

D
debabin
debabin
A
Alexander Lee
Alexander Lee

Released under the MIT License.