State Management · Senior · Question 47 of 75
How do you keep two browser tabs' client state in sync (e.g. logout in one tab)?
- ✓Correct answer: Broadcast changes with
BroadcastChannelor thestorageevent and update the store - 2Share one Redux store object between tabs
- 3Reload all tabs every minute
Explanation
Each tab is a separate JS realm with its own store. A message on logout lets other tabs clear their state; persist storage events can rehydrate Zustand. Server caches also refetch on focus.