kawkab-frontend
Version:
Kawkab frontend is a frontend library for the Kawkab framework
10 lines (9 loc) • 443 B
TypeScript
/**
* A React hook to manage a single cookie value.
* The component will re-render when the cookie value changes.
*
* @param key The name of the cookie.
* @param defaultValue The default value if the cookie is not set.
* @returns A state-like array: [value, updateValue, removeValue].
*/
export declare function useCookie(key: string, defaultValue?: string): [string | undefined, (newValue: string, days?: number) => void, () => void];