useConst ​
Hook that returns the constant value
typescript
import { useConst } from '@siberiacancode/reactuse';
Usage ​
typescript
const value = useConst('value');
Demo ​
Api ​
Parameters
Name | Type | Default | Note |
---|---|---|---|
initialValue | (() => Value) | Value | - | The initial value of the constant |