JsCommunity / JsCommunity/reaclette

`initialize` happen in child before parent

Open
#18 1 comment 1 reaction 1 assignee View on GitHub

@julien-f is already working on this.

Since Nov 23, 2018.

bug
Dominant language
JavaScript
Stars
2
Forks
3
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.