UNPKG

395 BTypeScriptView Raw
1import Cookies from 'js-cookie';
2export type State = string | undefined;
3export interface Options extends Cookies.CookieAttributes {
4 defaultValue?: State | (() => State);
5}
6declare function useCookieState(cookieKey: string, options?: Options): readonly [State, (newValue: State | ((prevState: State) => State), newOptions?: Cookies.CookieAttributes) => void];
7export default useCookieState;