How to share state(react) across multiple windows

I want to share data that is in React state across all active electron windows.
For now, I am keeping state in the renderer process and sharing it with IPC.

Is there a way to create a state in the main process. I am using React’s Context API for state and it can’t be done in the main process.