Very good job. Thank you for a thorough guide! Actually, there is a typo in your code within the post.
const additionalPatches = []; for (const additionalVChild of newVChildren.slice(oldVChildren.length)) { additionalPatches.push($node => { $node.appendChild(render(newVChildren)); return $node; }); }
Inside the function that we put into additionalPatches we should render not the newVChildren but the additionalVChild. This code appears in the first example in the explanation of diffChildren function.
additionalPatches
render
newVChildren
additionalVChild
diffChildren
You are a hero! Thanks for pointing that out! 🎉🎉🎉 I'll change it as soon as possible!
This typo is still in the article 😉
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Very good job. Thank you for a thorough guide!
Actually, there is a typo in your code within the post.
Inside the function that we put into
additionalPatcheswe shouldrendernot thenewVChildrenbut theadditionalVChild.This code appears in the first example in the explanation of
diffChildrenfunction.You are a hero! Thanks for pointing that out! 🎉🎉🎉 I'll change it as soon as possible!
This typo is still in the article 😉