mirror of
https://github.com/streamich/react-use.git
synced 2026-01-25 14:17:16 +00:00
Merge pull request #1 from jakyle/localStorage-optimized-useEffect
Update useLocalStorage.ts
This commit is contained in:
commit
0811b2bd1a
@ -31,7 +31,7 @@ const useLocalStorage = <T>(key: string, initialValue?: T, raw?: boolean): [T, (
|
||||
// If user is in private mode or has storage restriction
|
||||
// localStorage can throw. Also JSON.stringify can throw.
|
||||
}
|
||||
});
|
||||
}, [state]);
|
||||
|
||||
return [state, setState];
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user