Skip to content

initialize happen in child before parent #18

@julien-f

Description

@julien-f

The problem comes from the fact that componentDidMount is executed first in children then in parents.

Main issue: the child state can use the parent state before it's initialized.

Derived issue: the parent state can be updated (due to a child) before the parent injectState has subscribed to it, therefore the parent component will not be re-rendered.

Possible solution: if the child state has a parent, defer the call to initialize after the one of the parent.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions