Skip to content

Commit 9069195

Browse files
authored
Merge pull request #27 from blue119/patch-1
Update react-immutable-introduction.md
2 parents 55543f4 + 4e91df8 commit 9069195

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Ch06/react-immutable-introduction.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ ImmutableJS 提供了 7 種不可修改的資料類型:`List`、`Map`、`Stack
203203
傳統 JavaScript 比較方式,若資料型態為 Primitive 就不會有問題:
204204

205205
```javascript
206-
// 在 shouldComponentUpdate 比較接下來的 props 一否一致,若相同則不重新渲染,提昇效能
206+
// 在 shouldComponentUpdate 比較接下來的 props 是否一致,若相同則不重新渲染,提昇效能
207207
shouldComponentUpdate (nextProps) {
208208
return this.props.value !== nextProps.value;
209209
}
@@ -213,7 +213,7 @@ shouldComponentUpdate (nextProps) {
213213

214214
```javascript
215215
// 假設 this.props.value 為 { foo: 'app' }
216-
// 架設 nextProps.value 為 { foo: 'app' },
216+
// 假設 nextProps.value 為 { foo: 'app' },
217217
// 雖然兩者值是一樣,但由於 reference 位置不同,所以視為不同。但由於值一樣應該要避免重複渲染
218218
this.props.value !== nextProps.value; // true
219219
```

0 commit comments

Comments
 (0)