Skip to content

useConst ​

Category
Utilities

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

Contributors ​

Source • Demo