Skip to content

Commit

Permalink
fix some typos
Browse files Browse the repository at this point in the history
  • Loading branch information
lazysheep666 authored Nov 30, 2018
1 parent afa7d04 commit 6c8697c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions blog/update-contd.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ function traverseAllChildrenImpl(
}
```

这个函数乍一看比较复杂,但是花时间分析一下,就会发现其实还是很简洁的。在此之前我们先看一下这个函数式怎么被调用用的
这个函数乍一看比较复杂,但是花时间分析一下,就会发现其实还是很简洁的。在此之前我们先看一下这个函数是怎么被调用的

比如说在 mounting 阶段我们记得有一个步骤是在 `mountChildren` 中调用 `instantiateChildren`,这个方法是这样的:

Expand All @@ -105,7 +105,7 @@ function instantiateChildren(children) {

1. 一般情况下我们不提倡使用 mutate 方法,但是在 `traverAllChildren` 这个函数里我们看出它直接利用 callback 修改了参数 `traverseContext`,也就是 `childInstances`。也正因为如此,我们生成了所谓的 hash tree。
1. `traverseAllChildren` 中的 `nameSoFar` 正是 hash tree 中的每个 Component 的 key。
1. 注意 `traverseAllChildren` 并不会无限地递归到 leaf node,而只是**一层**的遍历。只要当前 child 是 **单个元素(即使它是一个 wrapper)**就不会再往里递归。
1. 注意 `traverseAllChildren` 并不会无限地递归到 leaf node,而只是**一层**的遍历。只要当前 child 是 **单个元素(即使它是一个 wrapper)** 就不会再往里递归。

[comment]: <> (Explain this in detail later)

Expand Down

0 comments on commit 6c8697c

Please sign in to comment.