Skip to content

useConst ​

utilities
test coverage
Last changed: 13 days ago

Hook that returns the constant value

typescript
import { useConst } from '@siberiacancode/reactuse';

Usage ​

typescript
const value = useConst('value');

Demo ​

Api ​

Parameters

NameTypeDefaultNote
initialValue(() => Value) | Value-The initial value of the constant

Returns

Value

Source ​

Source • Demo

Contributors ​

Avatardebabin

Released under the MIT License.