Open bharat-dussa opened 1 month ago
A hook for interacting with localStorage, allowing you to get and set values while persisting them in the browser's local storage.
Parameters:
key: string – The key to access in localStorage. initialValue: any – The initial value to set if no value exists.
Returns:
value: any – The current value in localStorage. setValue: (value: any) => void – A function to update the value in localStorage.
const [value, setValue] = useLocalStorage('theme', 'dark');
Goal: Create a hook that syncs state with localStorage, making it easy to store and retrieve persistent data.
pls assing this issue I won't to contribute @bharat-dussa
A hook for interacting with localStorage, allowing you to get and set values while persisting them in the browser's local storage.
Parameters:
Returns:
Goal: Create a hook that syncs state with localStorage, making it easy to store and retrieve persistent data.