Skip to content

Commit 6437167

Browse files
committed
update md
1 parent 1a1cb2f commit 6437167

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

react/summery/summery.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -874,11 +874,11 @@ React组件的数据渲染是否被调用者传递的`props`完全控制,控
874874

875875
- 条件渲染
876876

877-
```jsx
878-
{
879-
condition ? '❤️取消' : '🖤收藏'
880-
}
881-
```
877+
```jsx
878+
{
879+
condition ? '❤️取消' : '🖤收藏'
880+
}
881+
```
882882

883883
- 列表渲染
884884

@@ -1056,9 +1056,9 @@ React中组件也有生命周期,也就是说也有很多钩子函数供我们
10561056

10571057
1. componentDidCatch()
10581058

1059-
##各生命周期详解
1059+
## 各生命周期详解
10601060

1061-
#####1.constructor(props)
1061+
##### 1.constructor(props)
10621062

10631063
React组件的构造函数在挂载之前被调用。在实现`React.Component`构造函数时,需要先在添加其他内容前,调用`super(props)`,用来将父组件传来的`props`绑定到这个类中,使用`this.props`将会得到。
10641064

@@ -1123,7 +1123,7 @@ render()方法是必需的。当他被调用时,他将计算`this.props`和`th
11231123

11241124
React不会在组件初始化props时调用这个方法。调用`this.setState`也不会触发。
11251125

1126-
#####7.shouldComponentUpdate(nextProps, nextState)
1126+
##### 7.shouldComponentUpdate(nextProps, nextState)
11271127

11281128
调用`shouldComponentUpdate`使React知道,组件的输出是否受`state``props`的影响。默认每个状态的更改都会重新渲染,大多数情况下应该保持这个默认行为。
11291129

0 commit comments

Comments
 (0)