Skip to content

Commit c24edda

Browse files
authored
Return values as const to make the compiler happy in typescript
Based on this thread: microsoft/TypeScript#35423 I had to change the return type to be const to satisfy the typescript compiler
1 parent 776247a commit c24edda

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/pages/useLocalStorage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,6 @@ function useLocalStorage<T>(key: string, initialValue: T) {
127127
}
128128
};
129129

130-
return [storedValue, setValue];
130+
return [storedValue, setValue] as const;
131131
}
132132
```

0 commit comments

Comments
 (0)