DEV Community

Luca Dorigo
Luca Dorigo

Posted on

React state is being shared across iframes?

We have a next.js app that we normally run by embedding it in an iframe on a third-party website. It uses react and react-query for state management. For a specific usecase, we wanted to run two instances of our app on the same website, and noticed very weird behavior: the state of the two apps is getting jumbled together, and state changes in one iframe sometimes (not always) result in a state change in the other iframe. I wish I could give more details on when/how it happens, but I'm pretty confused by the issue and haven't been able to create a minimal reproducible example. Hopefully someone has an idea to help me troubleshoot?

Top comments (0)

Qodo Takeover

Introducing Qodo Gen 1.0: Transform Your Workflow with Agentic AI

Rather than just generating snippets, our agents understand your entire project context, can make decisions, use tools, and carry out tasks autonomously.

Read full post

πŸ‘‹ Kindness is contagious

Please leave a ❀️ or a friendly comment on this post if you found it helpful!

Okay