useCookie ​
browser
test coverage
Last changed: 4 days ago
Hook that manages cookie value
typescript
import { useCookie } from '@siberiacancode/reactuse';
Usage ​
typescript
const { value, set, remove } = useCookie('key', 'value');
Demo ​
Api ​
Parameters
Name | Type | Default | Note |
---|---|---|---|
key | string | - | The key of the cookie |
initialValue? | UseCookieInitialValue<Value> | - | The initial value of the cookie |