devhammed/use-cookie

cookie value not updated on external cookie change

Opened this issue · 2 comments

Hi,

What I did:
update cookie in browser cookie settings with another value.
Value is not reflected in example ui, but on page reload

Hello @raDiesle,

Yeah, you have to reload the page for it to capture the browser value.
This feature you are requesting for requires watching the browser cookie value and syncing with the React state. Though, the initial plan is to hydrate the browser value on page load then only sync updates from React state to Browser. I will see what I can do.

Thanks for using!

Screenshot from 2020-01-06 08-57-26

I am already working on your feature request, don't know if using setInterval is the best for the job though.

Do you have a better suggestion?