Share states across tabs and child windows in React Application

Jimmy
3 min readSep 4, 2022

Sometimes there’s a need to open a new tab or new windows for your React application and you want to sync the state between those child windows with the main one. For example, when using chat application like Slack, you may want to chat with multiple people in a separate window instead of go switch between them on the side rail.

There’re articles sharing the techniques that leverages localStorage to achieve this. But localStorage has a 5MB per App per browser limit so it won’t go too far. The method I’m introducing will…

--

--

Jimmy

Software Engineer @Microsoft, ex Apple, Amazon Dev