We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
function reconcileChildren(wipFiber, elements) { let index = 0; let oldFiber = wipFiber.alternate && wipFiber.alternate.child; let prevSibling = null; while (index < elements.length || oldFiber != null) { const element = elements[index]; let newFiber = null; const sameType = oldFiber && element && element.type == oldFiber.type; if (sameType) { newFiber = { type: oldFiber.type, props: element.props, dom: oldFiber.dom, parent: wipFiber, alternate: oldFiber, effectTag: "UPDATE" }; } if (element && !sameType) { newFiber = { type: element.type, props: element.props, dom: null, parent: wipFiber, alternate: null, effectTag: "PLACEMENT" }; } if (oldFiber && !sameType) { oldFiber.effectTag = "DELETION"; deletions.push(oldFiber); } if (oldFiber) { oldFiber = oldFiber.sibling; } if (index === 0) { wipFiber.child = newFiber; } else if (element) { prevSibling.sibling = newFiber; } prevSibling = newFiber; index++; } }
When I use '!==' like
while (index < elements.length || oldFiber !== null) { ... }
and When I input and then I can't continue typing, the browser is also stuck. Why ?
The text was updated successfully, but these errors were encountered:
"wipFiber.alternate.child" may be 'undefined'
Sorry, something went wrong.
I ran into this problem as well.
while (index < elements.length || oldFiber) {
simpler slution 🤗️
because oldFiber maybe is undefined , and undefined !==null always return true ,then endless loop
No branches or pull requests
When I use '!==' like
and When I input and then I can't continue typing, the browser is also stuck. Why ?
The text was updated successfully, but these errors were encountered: