Skip to content

Infinite render loop with deeply dynamic children #21

@bluespore

Description

@bluespore

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions