From 3b21f3e29a52a79f40f791675031fdcf8788603f Mon Sep 17 00:00:00 2001 From: MrWangJustToDo <2711470541@qq.com> Date: Mon, 18 Nov 2024 15:52:26 +0800 Subject: [PATCH] update --- package.json | 2 +- packages/myreact-terminal/src/api/position/feature.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 6508730f..cb2f111d 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "lint": "eslint --cache --ext ts,tsx .", "lint:fix": "pnpm run lint --fix", "prettier": "prettier --ignore-path .prettierignore --write .", - "clean": "pnpm -p -r -c exec rm -rf dist dev .cache", + "clean": "pnpm -p -r -c exec rm -rf dist dev .cache .next", "purge": "pnpm -p -r -c exec rm -rf node_modules" }, "husky": { diff --git a/packages/myreact-terminal/src/api/position/feature.ts b/packages/myreact-terminal/src/api/position/feature.ts index 1d2649fa..059b9826 100644 --- a/packages/myreact-terminal/src/api/position/feature.ts +++ b/packages/myreact-terminal/src/api/position/feature.ts @@ -18,9 +18,9 @@ export const position = (fiber: MyReactFiberNode, renderDispatch: TerminalDispat const beforeFiberWithDom = getInsertBeforeDomFromSiblingAndParent(fiber, parentFiberWithNode || rootFiber); if (beforeFiberWithDom) { - insertBefore(fiber, beforeFiberWithDom, parentFiberWithNode); + insertBefore(fiber, beforeFiberWithDom, parentFiberWithNode || renderDispatch); } else { - append(fiber, parentFiberWithNode); + append(fiber, parentFiberWithNode || renderDispatch); } fiber.patch = remove(fiber.patch, PATCH_TYPE.__position__);