use-persisted-state icon indicating copy to clipboard operation
use-persisted-state copied to clipboard

Syncing sessionStorage across tabs

Open nerdstep opened this issue 6 years ago • 1 comments

This is probably unconventional, but I currently have an use-case where I'd like to use sessionStorage as the storageProvider and have the value synced across tabs/windows similar to the localStorage provider.

The use-case is a splash screen that the user clicks through once upon application load, so sessionStorage is ideal in this situation since they shouldn't see it again upon browser refresh, but I'd like this value to also sync across tabs.

Any thoughts on whether or not it's a feasible goal for this hook?

nerdstep avatar Mar 13 '19 22:03 nerdstep

Probably a bit late, but sessionStorage per definition can't be shared across tabs. That is not an issue with the hook. More info here.

tiagojufr avatar May 12 '21 11:05 tiagojufr