Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/hooks/useLocalStorage.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const getLocalValue = (key, initValue) => {

// if a value is already store
const localValue = JSON.parse(localStorage.getItem(key));
if (localValue) return localValue;
if (localValue !== undefined) return localValue;

// return result of a function
if (initValue instanceof Function) return initValue();
Expand All @@ -26,4 +26,4 @@ const useLocalStorage = (key, initValue) => {
return [value, setValue];
}

export default useLocalStorage
export default useLocalStorage