Merge pull request #1 from jakyle/localStorage-optimized-useEffect

Update useLocalStorage.ts
This commit is contained in:
James Jackson 2019-06-25 23:13:52 -04:00 committed by GitHub
commit 0811b2bd1a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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];
};