astoilkov / use-local-storage-state

React hook that persists data in localStorage
MIT License
1.1k stars 41 forks source link

Does not respond to changes to localStorage made elsewhere in the application #45

Closed tnrich closed 2 years ago

tnrich commented 2 years ago

Just a heads up for other users of this library that it does not respond to changes made to localStorage from within the same tab unless those changes are made via the hook.

You can see an example of that here https://codesandbox.io/s/todos-example-use-local-storage-state-forked-uppgko?file=/src/App.tsx:0-41 by toggling between the two libraries on lines 1 and 2.

astoilkov commented 2 years ago

Cool. If anybody is interested in the additional features here is the link to the fork: https://github.com/tnrich/use-local-storage-state.

I will close this issue now because there isn't an actionable item here. I hope people who are interested in these features can find your fork.

tnrich commented 2 years ago

Sounds good thanks @astoilkov