useRafState ​
Hook that returns the value and a function to set the value
state
test coverage
Last changed: 2 days ago
Installation ​
Library
CLI
Manual
typescript
import { useRafState } from '@siberiacancode/reactuse';
Usage ​
typescript
const [value, setValue] = useRafState(initialValue);
Demo ​
Api ​
Type declaration ​
typescript
export type UseRafStateReturn<Value> = [Value, (value: Value) => void];
Source ​
Source • DemoContributors ​
D