virtual-dom icon indicating copy to clipboard operation
virtual-dom copied to clipboard

Lazy top-level view crashes when patches happen after the rootnode changed

Open zwilias opened this issue 7 years ago • 2 comments

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.

zwilias avatar Aug 03 '17 07:08 zwilias

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.

process-bot avatar Aug 03 '17 07:08 process-bot

It seems if you wrap it in another node that it fixes the crash https://ellie-app.com/cjSYRKqh5a1/0

antew avatar Apr 12 '18 03:04 antew