Skip to content

Commit 8ff7e50

Browse files
committed
perf: allow state change before mount
1 parent e1fcc3d commit 8ff7e50

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/useCached.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export function useCached({dbName = 'Cached', storeName = 'keyval', context = tr
2626

2727
const [, setState] = useState({})
2828

29-
const mounted = useRef(false)
29+
const mounted = useRef(true)
3030
useEffect(() => {
3131
mounted.current = true
3232
return () => { mounted.current = false}

0 commit comments

Comments
 (0)