Skip to content

Commit

Permalink
🐜 reverse order
Browse files Browse the repository at this point in the history
  • Loading branch information
astoilkov committed Jun 25, 2024
1 parent 2fddc43 commit 00d8810
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/useLocalStorageState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ function useLocalStorage<T>(
}

const onStorage = (e: StorageEvent): void => {
if (e.storageArea === goodTry(() => localStorage) && e.key === key) {
if (e.key === key && e.storageArea === goodTry(() => localStorage)) {
triggerCallbacks(key)
}
}
Expand Down

0 comments on commit 00d8810

Please sign in to comment.