You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
82 lines
1.9 KiB
82 lines
1.9 KiB
3 years ago
|
tag :
|
||
3 years ago
|
>表示 Fiber 的类型,根据 ReactElement 组件的 `type` 生成
|
||
3 years ago
|
|
||
3 years ago
|
elementType :
|
||
|
>大部分时候和 type 是相同的
|
||
|
>FunctionComponent 使用 React.memo 会有不同
|
||
3 years ago
|
|
||
3 years ago
|
type :
|
||
3 years ago
|
>FunctionComponent 而言是函数本身
|
||
|
>ClassComponent 而言是 Class
|
||
|
>Host Component 而言是 DOM 节点的 Tag Name
|
||
3 years ago
|
|
||
3 years ago
|
key :
|
||
3 years ago
|
>和 ReactElement 的 key 属性一致
|
||
3 years ago
|
|
||
3 years ago
|
stateNode :
|
||
3 years ago
|
>HostComponent 而言,是它的真实 DOM 节点
|
||
|
>ClassComponent 而言是 clsss 实例
|
||
3 years ago
|
|
||
3 years ago
|
return :
|
||
3 years ago
|
>指向父节点
|
||
3 years ago
|
|
||
3 years ago
|
child :
|
||
3 years ago
|
>指向第一个子节点
|
||
3 years ago
|
|
||
3 years ago
|
sibling :
|
||
3 years ago
|
>指向下一个兄弟节点
|
||
3 years ago
|
|
||
3 years ago
|
index :
|
||
3 years ago
|
>代表在多个同级 Fiber 节点中,它们插入的位置索引
|
||
|
>单节点默认为 0
|
||
3 years ago
|
|
||
3 years ago
|
ref :
|
||
3 years ago
|
>指向在 ReactElement 组件上设置的 ref
|
||
3 years ago
|
|
||
3 years ago
|
pendingProps:
|
||
3 years ago
|
>组件的属性,也就是 ReactElement 传入的 props
|
||
3 years ago
|
>用于和后边的 memoizedProps 属性比较判断组件属性是否发生变化
|
||
|
>在生成子 Fiber 节点之后被赋值到 memoizedProps
|
||
3 years ago
|
|
||
3 years ago
|
memoizedProps:
|
||
|
>上一次组件生成的属性,用于和上边的 pendingProps 进行比较
|
||
3 years ago
|
|
||
3 years ago
|
alternate :
|
||
3 years ago
|
>指向在内存中的另外一条 Fiber 树
|
||
3 years ago
|
|
||
3 years ago
|
updateQueue :
|
||
|
>存储 update更新对象 的队列,每次发起更新,都需要在该队列上创建一个 update 对象
|
||
3 years ago
|
|
||
3 years ago
|
memoizedState:
|
||
3 years ago
|
>上一次生成子组件之后组件的状态
|
||
|
|
||
3 years ago
|
dependencies:
|
||
3 years ago
|
>该 Fiber 节点所依赖的 (contexts, events)
|
||
|
|
||
3 years ago
|
mode :
|
||
3 years ago
|
>和 React 的运行模式有关
|
||
|
|
||
3 years ago
|
flags :
|
||
3 years ago
|
>用于标记组件的副作用,reconciler 会将所有存在 flag 标记的 Fiber 节点添加进 effectList 链表中,交给 commit 阶段
|
||
|
|
||
3 years ago
|
subtreeFlags :
|
||
3 years ago
|
>替代 16.x 版本中的 firstEffect、lastEffect,默认未开启
|
||
|
|
||
3 years ago
|
deletions :
|
||
3 years ago
|
>存储将要被删除的子组件,默认未开启
|
||
|
|
||
3 years ago
|
nextEffect :
|
||
3 years ago
|
> 指向下一个有副作用的 Fiber 节点
|
||
3 years ago
|
|
||
3 years ago
|
firstEffect :
|
||
3 years ago
|
>指向副作用链表的第一个 Fiber 节点
|
||
3 years ago
|
|
||
3 years ago
|
lastEffect :
|
||
3 years ago
|
>指向副作用链表的最后一个 Fiber 节点
|
||
3 years ago
|
|
||
3 years ago
|
lanes :
|
||
3 years ago
|
> Fiber 节点的优先级
|
||
3 years ago
|
|
||
3 years ago
|
childLanes :
|
||
3 years ago
|
>子 Fiber 节点的优先值
|