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

Scheduling: cancelling render from parent can cancel render triggered in child #1501

Open
sdegueldre opened this issue Aug 1, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@sdegueldre
Copy link
Contributor

Playground

Here, onWillUpdateProps is executed and mutates the state, so the component should render, but because there is already a render coming from the parent component, no new render is actually scheduled. When the parent component restores the state to its previous value, the props are no longer different from the commited props and the render from the parent is canceled, and the rendering corresponding to the state mutation is lost in the ether.

in ComponentNode.prototype.render, the lines

if (current) {
  if (!current.bdom && !fibersInError.has(current)) {
    return;
  }
}

make it so that the render coming from the child won't schedule a rendering if one is already scheduled but not completed (ie no bdom), but doesn't account for the fact that this rendering may be canceled by the parent

@sdegueldre sdegueldre added the bug Something isn't working label Jun 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant