A hook to use a cookie store
// Wrap your component with CookiesStoreProvider to use useCookiesStore hook.<CookiesStoreProvider> <MyComponent /></CookiesStoreProvider>function MyComponent() { const [value, setValue, unsetValue, isLoading] = useCookiesStore('key', 'defaultValue'); return <div>{value}</div>;} Copy
// Wrap your component with CookiesStoreProvider to use useCookiesStore hook.<CookiesStoreProvider> <MyComponent /></CookiesStoreProvider>function MyComponent() { const [value, setValue, unsetValue, isLoading] = useCookiesStore('key', 'defaultValue'); return <div>{value}</div>;}
A hook to use a cookie store