What is the current behavior?
useLocalStorageValue yields undefined on first render if initializeWithValue not set to true and on second render yield actual value from localStorage.
https://codesandbox.io/s/wispy-forest-qmrlzn?file=/src/App.tsx
What is the expected behavior?
initializeWithValue: true should be default behavior based on documentation and previous behaviour.
Environment Details
- _
@react-hookz/web version: 17.0
- _
react version: 18.2
- _
react-dom version: 18.2
- _
typescript version: 4.8.4
- _OS: macos
- _Browser: chrome
- _Did this work in previous versions? yes
What is the current behavior?
useLocalStorageValueyields undefined on first render ifinitializeWithValuenot set to true and on second render yield actual value from localStorage.https://codesandbox.io/s/wispy-forest-qmrlzn?file=/src/App.tsx
What is the expected behavior?
initializeWithValue: trueshould be default behavior based on documentation and previous behaviour.Environment Details
@react-hookz/webversion: 17.0reactversion: 18.2react-domversion: 18.2typescriptversion: 4.8.4