Skip to content

Commit 0a9b088

Browse files
committed
Add comment
1 parent 39a8568 commit 0a9b088

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

web/hooks/use-persistent-local-state.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { useEvent } from 'web/hooks/use-event'
77
import { useIsClient } from 'web/hooks/use-is-client'
88

99
export const usePersistentLocalState = <T>(initialValue: T, key: string) => {
10+
// Note: use a version (like "-v1") in the key to increment after backwards-incompatible changes
1011
const isClient = useIsClient()
1112
const [state, setState] = useStateCheckEquality<T>(
1213
(isClient && safeJsonParse(safeLocalStorage?.getItem(key))) || initialValue

0 commit comments

Comments
 (0)