nas5w/use-local-storage

Stale keys and default values

franciscop opened this issue · 0 comments

Describe the bug
The keys, default values, etc. all become stale when they change (using the old ones instead of the new ones), since they are not being depended properly by the dependencies array.

To Reproduce
Run the tests in here:
#26

Expected behavior
If you change the key, the hook uses the new one instead of the old one. Same for the default value.

Screenshots
image

Desktop (please complete the following information):
Any

Smartphone (please complete the following information):
Any

Additional context
Add any other context about the problem here.