Skip to content

useRefState

Hook that returns the state reference of the value

state
low
test coverage
Last changed: 3 months ago

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

SourceDemo

Contributors

D
debabin
debabin
A
Alexander Lee
Alexander Lee

Released under the MIT License.