Skip to content

Commit

Permalink
🐜 reverse order
Browse files Browse the repository at this point in the history
  • Loading branch information
astoilkov committed Jul 8, 2024
1 parent 00d8810 commit 87a5292
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 @@ -106,7 +106,7 @@ function useLocalStorage<T>(
// issues that were caused by incorrect initial and secondary implementations:
// - https://github.com/astoilkov/use-local-storage-state/issues/30
// - https://github.com/astoilkov/use-local-storage-state/issues/33
if (string === null && defaultValue !== undefined) {
if (defaultValue !== undefined && string === null) {
// reasons for `localStorage` to throw an error:
// - maximum quota is exceeded
// - under Mobile Safari (since iOS 5) when the user enters private mode
Expand Down

0 comments on commit 87a5292

Please sign in to comment.