From 5dd0186304bd17cb16aa7d7e8b54fcdfdcfd4c13 Mon Sep 17 00:00:00 2001 From: Jude <329543240@qq.com> Date: Sat, 25 Sep 2021 20:21:44 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20beginWork=E5=87=BD=E6=95=B0=E4=B8=AD?= =?UTF-8?q?=E7=9A=84=E5=8F=82=E6=95=B0=E8=A7=A3=E9=87=8A=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 这里的fiberRootNode应该是rootFiber吧,虽然fiberRootNode在此时确实有current属性,但是这个函数里的current指代的实际上应该是alternate吧 --- docs/process/beginWork.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/process/beginWork.md b/docs/process/beginWork.md index 517a46c..c8330e5 100644 --- a/docs/process/beginWork.md +++ b/docs/process/beginWork.md @@ -33,7 +33,7 @@ function beginWork( - `update`时:如果`current`存在,在满足一定条件时可以复用`current`节点,这样就能克隆`current.child`作为`workInProgress.child`,而不需要新建`workInProgress.child`。 -- `mount`时:除`fiberRootNode`以外,`current === null`。会根据`fiber.tag`不同,创建不同类型的`子Fiber节点` +- `mount`时:除`rootFiber`以外,`current === null`。会根据`fiber.tag`不同,创建不同类型的`子Fiber节点` ```js function beginWork(