Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Infinite render loop with deeply dynamic children #21

Open
bluespore opened this issue Feb 21, 2017 · 1 comment
Open

Infinite render loop with deeply dynamic children #21

bluespore opened this issue Feb 21, 2017 · 1 comment

Comments

@bluespore
Copy link

Description

I've got a Modal component which renders the modal box + its children if it's own open prop is set to true. This is run through VelocityTransitionGroup, which means if the open prop changes, it'll add remove/children respectively.

This causes an infinite render bug due, which I believe is due to lines 34 - 36 in GatewayRegistry.js.

Background information

The purpose of using react-gateway was to avoid an issue with nested forms, where the modal rendered its own form, after being triggered by an existing form's element event.

Question

Why is it necessary to completely delete all the children?

If my Modal is set to open={true}, it'll continuously try to re-render the children, because sending a <Modal open={true} /> into Gateway instructs the modal to add its own children, thus triggering componentWillReceiveProps onGateway, and effectively deleting it and adding it continuously.

@bluespore
Copy link
Author

Alright, I might have caused a recursive loop with the content I was trying to load into this Modal.
I'd suppose if we shift the focus toward what the core idea is behind the rendering/replacing of the children to the Gateway, that might help me understand what went wrong there. Sorry for any confusion, I can appreciate the ticket was a little loose.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant