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

Duplicate deletion commit #29

Open
EnrigleZ opened this issue Oct 18, 2020 · 0 comments
Open

Duplicate deletion commit #29

EnrigleZ opened this issue Oct 18, 2020 · 0 comments

Comments

@EnrigleZ
Copy link

Thanks for your blog and code sharing, Didact is awesome!

I got an issue here when I tried to delete several siblings in the same time.

didact/didact.js

Lines 124 to 129 in a127ff4

} else if (fiber.effectTag === "DELETION") {
commitDeletion(fiber, domParent)
}
commitWork(fiber.child)
commitWork(fiber.sibling)

In this line, after one fiber gets deleted, its sibling will commitWork next, which has been already registered in deletions.

As a result, some fiber will be deleted more than once (after its sibling and in deletions.forEach), which will cause an error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant