usehooks icon indicating copy to clipboard operation
usehooks copied to clipboard

window.localStorage.clear() not working with useLocalStorage hook

Open dhiraj-shipmnts opened this issue 4 months ago • 0 comments

Please see the video attached here

https://github.com/user-attachments/assets/f38c529b-a982-444e-ae86-a57b6d46493c

If you observe, when I clear storage in a tab, it does not sync back to the other tab and as I update the local storage in the that tab, complete data gets synced back to the previous tab. Ideally, clearing the storage should also have synced to the other tabs.

This recording is from the useLocalStorage hook's demo, but I am facing the same thing while using this hook.

Are there any solutions for this?

dhiraj-shipmnts avatar Jun 09 '25 18:06 dhiraj-shipmnts