Skip to content

Commit fb75e90

Browse files
committed
Golf hydration 2.0
1 parent d73e964 commit fb75e90

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/diff/index.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -293,8 +293,7 @@ export function diff(
293293
// if hydrating or creating initial tree, bailout preserves DOM:
294294
if (isHydrating || excessDomChildren != NULL) {
295295
if (e.then) {
296-
let shouldFallback = true,
297-
commentMarkersToFind = 0,
296+
let commentMarkersToFind = 0,
298297
done = false;
299298

300299
newVNode._flags |= isHydrating
@@ -318,7 +317,6 @@ export function diff(
318317
newVNode._component._excess.push(child);
319318
}
320319
commentMarkersToFind++;
321-
shouldFallback = false;
322320
excessDomChildren[i] = NULL;
323321
} else if (child.nodeType == 8 && child.data == '/$s') {
324322
commentMarkersToFind--;
@@ -334,13 +332,13 @@ export function diff(
334332
}
335333
}
336334

337-
if (shouldFallback) {
335+
if (!done) {
338336
while (oldDom && oldDom.nodeType == 8 && oldDom.nextSibling) {
339337
oldDom = oldDom.nextSibling;
340338
}
341339

342340
excessDomChildren[excessDomChildren.indexOf(oldDom)] = NULL;
343-
newVNode._component._excess.push(oldDom);
341+
newVNode._component._excess = [oldDom];
344342
}
345343

346344
newVNode._dom = oldDom;

0 commit comments

Comments
 (0)