Files
madbase/control-plane-ui/node_modules/@mui/utils/useLocalStorageState/useLocalStorageState.d.ts
Vlad Durnea cffdf8af86
Some checks failed
CI/CD Pipeline / unit-tests (push) Failing after 1m16s
CI/CD Pipeline / integration-tests (push) Failing after 2m32s
CI/CD Pipeline / lint (push) Successful in 5m22s
CI/CD Pipeline / e2e-tests (push) Has been skipped
CI/CD Pipeline / build (push) Has been skipped
wip:milestone 0 fixes
2026-03-15 12:35:42 +02:00

18 lines
768 B
TypeScript

import * as React from 'react';
type Initializer = () => string | null;
type UseStorageStateHookResult = [
string | null,
React.Dispatch<React.SetStateAction<string | null>>
];
/**
* Sync state to local storage so that it persists through a page refresh. Usage is
* similar to useState except we pass in a storage key so that we can default
* to that value on page load instead of the specified initial value.
*
* Since the storage API isn't available in server-rendering environments, we
* return null during SSR and hydration.
*/
declare function useLocalStorageStateBrowser(key: string | null, initializer?: string | null | Initializer): UseStorageStateHookResult;
declare const _default: typeof useLocalStorageStateBrowser;
export default _default;