Open h5gq3 opened 1 year ago
Is this a regression in v1.0.0-beta.30
released on 2023-07-12
(3 days ago)?
no, it's been this way since i encountered this few months ago
I dropped this test into the dom node section of the unit tests and was able to reproduce the failure:
Definitely looks like a bug, thanks for reporting!
This is the offending line: https://github.com/tbranyen/diffhtml/blob/master/packages/diffhtml/lib/transaction.js#L135
Looks like we're reusing the state from a previous render, instead of creating a new transaction state for the updates. When I remove: StateCache.get(mount) ||
the test passes:
I think I have a fix. When we encounter a previous mount being added into a new mount, we remove the previous StateCache. This occurred when you put p
into fixture
.
illustrated by this test: