Skip to content
Discussion options

You must be logged in to vote

I can see that the documentation is not very good on that topic.

In the two examples above, the incorrect case is because the two trees that are being patched are:

const tree = block1();
const tree2 = block2();

But as you can see, the first tree is created from a function coming from a different createBlock than the second one. That is the problem.

This is kind of a subtle issue. This comes from the fact that, to optimize performance as much as possible, blockdom does not check if two virtual tree are the same. Whenever blockdom is patching a vnode, it blindly assumes that the target vnode is of the same type, and applies directly the patch operation from the first vnode with the data/chi…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by HamedFathi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants