Skip to content

render is called in the wrong order for connected nested components #509

Closed
@ynonp

Description

@ynonp

Consider the following where both components are connected to a store:

<Parent>
  {hasChild && <Child />}
</Parent>

hasChild is a parent prop that is received from store.

If a single action changes both hasChild and a separate property that affects the child, first Child's render is called and only then Parent's render is called removing Child from the tree (unlike normal react flow)

Currently I used shouldComponentUpdate in Child to prevent redundant renders, but that involves implementing shouldComponentUpdate in every case.

Any ideas for a generic solution?

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