web icon indicating copy to clipboard operation
web copied to clipboard

chore(docs): identify that useLocalStorageValue is sync'd across tabs

Open develohpanda opened this issue 2 years ago • 5 comments

What is the problem?

While reading through the migrate from react-use docs I incorrectly determined that the new useLocalStorageValue hook was not sync'd across tabs, because of this note

image

What changes does this PR make to fix the problem?

Explicitly identify in the useLocalStorageValue() docs that the value is kept in sync across tabs.

Checklist

  • [ ] Is there an existing issue for this PR?
    • link issue here

develohpanda avatar Aug 14 '23 09:08 develohpanda

You'd better also fix the issue within migration guide https://github.com/react-hookz/web/blob/master/src/docs/migrating-from-react-use.story.mdx

Thanks for contribution

xobotyi avatar Aug 14 '23 12:08 xobotyi

I believe synchronization been implemented after one of refactors of that hook🤔 Bu i forgot to update migration guide.

xobotyi avatar Aug 14 '23 12:08 xobotyi

@xobotyi I thought that I had misread the migration guide.

Should this be referring to useLocalStorageValue() from this package, or useLocalStorage() from react-use?

image

(Presumably it is referring to useLocalStorageValue())

develohpanda avatar Aug 14 '23 22:08 develohpanda

@develohpanda it shuld describe how it works within react-hookz version. After second read i've done it opposite way from the moment i've wrote the comment 🙃 IMO it would be better to rephraze whole note about sync

xobotyi avatar Aug 14 '23 22:08 xobotyi

Sounds good, thanks for confirming! I'll update and push to this branch.

develohpanda avatar Aug 14 '23 22:08 develohpanda