useCookie
Read, write, and remove cookies.
useCookie.tsx
import { useCookie } from "@cermuel/hooks/react";export function useCookieExample() { const cookie = useCookie("theme", "system"); return <button type="button" onClick={() => cookie.set("dark")}>{cookie.value}</button>;}Props
Param
Type
Default Value
namestringinitialValueToptions?CookieOptions<T>{}Returns
{ value: T; set: (next: T) => void; remove: () => void; }