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

[Fiber] Formalize States #8012

Open
sebmarkbage opened this issue Oct 19, 2016 · 0 comments
Open

[Fiber] Formalize States #8012

sebmarkbage opened this issue Oct 19, 2016 · 0 comments
Labels
Component: Reconciler React Core Team Opened by a member of the React Core Team Type: Enhancement

Comments

@sebmarkbage
Copy link
Collaborator

sebmarkbage commented Oct 19, 2016

In Fiber there are a number of states that a component can be in. However, it is not formalized in the code right now. Instead, the state is inferred. This leads to hard to follow code. Instead we can organize the code in terms of explicit states - which is what the original prototype did.

Before componentDidMount (i.e. current === null):

  • Never begun.
  • Have been begun before but never completed.
  • Have been completed before, not committed, but hasn't begun this time around.
  • Begun but not yet completed.
  • Completed but not yet committed.

After componentDidMount (i.e. current !== null):

  • Haven't begun an update yet
  • Have been begun before but never completed.
  • An update have been completed before, not committed, but hasn't begun this update.
  • Begun update but not yet completed.
  • Completed update but not yet committed.

The "children" set of a component also have some states:

  • Never reconciled.
  • The current set last committed.
  • A previously reconciled set that hasn't committed yet.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Reconciler React Core Team Opened by a member of the React Core Team Type: Enhancement
Projects
None yet
Development

No branches or pull requests

3 participants