cookies-react
v0.0.3
Published
A simple react hook for cookies
Downloads
40
Readme
A package for cookies in react
This package is a simple react hook for cookies. It allows you to get and set cookies in your react application.
How to use:
npm install cookies-react
import useCookie from 'cookies-react';
const cookie = useCookie();
useEffect(() => {
if (!window) return;
cookie.set('myCookie', 'myValue', 7);
cookie.get('myCookie');
cookie.delete('myCookie');
}, [cookie]);