diff --git a/packages/react/runtime/src/lifecycle/patch/commit.ts b/packages/react/runtime/src/lifecycle/patch/commit.ts index 83a9e7d351..97d1224ed0 100644 --- a/packages/react/runtime/src/lifecycle/patch/commit.ts +++ b/packages/react/runtime/src/lifecycle/patch/commit.ts @@ -153,7 +153,7 @@ function replaceCommitHook(): void { id: commitTaskId, }; // TODO: check all fields in `flushOptions` from runtime3 - if (snapshotPatch?.length) { + if (snapshotPatch.length) { patch.snapshotPatch = snapshotPatch; } const patchList: PatchList = { @@ -162,7 +162,7 @@ function replaceCommitHook(): void { if (!isEmptyObject(flushOptions)) { patchList.flushOptions = flushOptions; } - if (snapshotPatch && delayedRunOnMainThreadData.length) { + if (delayedRunOnMainThreadData.length) { patchList.delayedRunOnMainThreadData = takeDelayedRunOnMainThreadData(); } const obj = commitPatchUpdate(patchList, patchOptions); diff --git a/packages/react/runtime/src/snapshot/backgroundSnapshot.ts b/packages/react/runtime/src/snapshot/backgroundSnapshot.ts index 1d9f4c3bff..b2b610c5f9 100644 --- a/packages/react/runtime/src/snapshot/backgroundSnapshot.ts +++ b/packages/react/runtime/src/snapshot/backgroundSnapshot.ts @@ -282,9 +282,6 @@ export class BackgroundSnapshotInstance { let node = this.__firstChild; while (node) { nodes.push(node); - if (node === this.__lastChild) { - break; - } node = node.__nextSibling; } return nodes;