use-persisted-state
use-persisted-state copied to clipboard
Syncing sessionStorage across tabs
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?
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.