Skip to content

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

NameTypeDefaultNote
keystring-The key of the cookie
initialValue?UseCookieInitialValue<Value>-The initial value of the cookie

Source ​

Source • Demo

Contributors ​

Avatardebabin
Avatarbabin