virtual-dom
virtual-dom copied to clipboard
Lazy top-level view crashes when patches happen after the rootnode changed
SSCCE: https://ellie-app.com/3Vd6CqrthVYa1/2
On init, the rootnode is changed. After that, clicking the click me div results in applying a patch within that changed rootnode. Stepping through that process with a debugger reveals the rootnode is still an h4 at that point. The p-thunk patch can't seem to replace the rootnode.
p-thunk's domNode property is undefined so the result of applyPatch cannot replace the actual node. This then later on results in patches being applied to the wrong DOM node, and stuff blowing up.
Thanks for the issue! Make sure it satisfies this checklist. My human colleagues will appreciate it!
Here is what to expect next, and if anyone wants to comment, keep these things in mind.
It seems if you wrap it in another node that it fixes the crash https://ellie-app.com/cjSYRKqh5a1/0