Skip to content

Commit

Permalink
Return values as const to make the compiler happy in typescript
Browse files Browse the repository at this point in the history
Based on this thread:
microsoft/TypeScript#35423
I had to change the return type to be const to satisfy the typescript compiler
  • Loading branch information
philipp985 authored Nov 19, 2020
1 parent 776247a commit c24edda
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/pages/useLocalStorage.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,6 @@ function useLocalStorage<T>(key: string, initialValue: T) {
}
};

return [storedValue, setValue];
return [storedValue, setValue] as const;
}
```

0 comments on commit c24edda

Please sign in to comment.