Matt-Esch/virtual-dom

The key of vNode cannot be 0.

monkingxue opened this issue · 0 comments

When I read the source code of keyIndex function, I found that if I have a vNode with the key is 0, the vNode will be add to free array instead of keys, I am confused.

image

I think the if (child.key) is the source to due to this result.

Is a bug or a special design? if it's a special design, why to design it?