use-persisted-state
use-persisted-state copied to clipboard
A custom React Hook that provides a multi-instance, multi-tab/browser shared and persistent state.
I definitely like the idea and mostly of how it's implemented, but the somewhat big caveat to me as DRY guy is repeating the initial state. I mean with regular...
Hey, I would like to use `use-persisted-state` with `AsyncStorage` available in react-native. The problem is that it returns `Promise`s instead of plain values. Do you think it would be possible...
For example: ```jsx const useOpts = createPersistedState('key'); const Comp = props => { const [opts, setOpts] = useOpts({ show: false }); useEffect(() => { if (opts.show) { console.log('Show'); } else...
Using the package on development mode from the git repo does not work. - Works: `yarn run dev`. It does not throw any error on console. - Works: `yarn run...
from the sources: ``` const newState = JSON.parse(newValue); if (k === key && state !== newState) ``` `state !== newState` would always resolve to true since newState is just a...
It will be nice to add a codesandbox link into README to show how to use it in action.
This looks great, at first glance the main thing lacking is an equivalent of useReducer for more complex state management. Any interest in extending it a bit?
I added react 18 as a valid peer dependecy. I also updated the dev dependecies to react. So when I ran the tests they where running fine with react 18....
Needs support for React 18. Gives errors on installations, upgrades etc (npm i)
 How to solve this issue?