DEV Community

Thomas Wink
Thomas Wink

Posted on • Edited on

React modal dialog re-renders parent component

Hi All,

I have a parent component with reactive vars that are populated with data from a Mongo collection. The child modal dialog modifies this information, causing a re-render of the parent component — and also the modal dialog.

Obviously the modal dialog shouldn't be re-rendered. I tried lifting the open/close state to the parent, but the re-renders still occur.

What are ways that I can prevent this from happening?

Thanks in advance!

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

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

Okay