Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
yifu-study-front-share
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
CI / CD
CI / CD
Pipelines
Schedules
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
yifu-study
front
yifu-study-front-share
Commits
7243d174
Commit
7243d174
authored
Apr 01, 2022
by
caihaifei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update.
parent
c3d04981
Pipeline
#15491
failed with stage
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
探究React中setState的执行机制.md
source/_posts/探究React中setState的执行机制.md
+7
-5
No files found.
source/_posts/探究React中setState的执行机制.md
View file @
7243d174
---
title
:
探究React中setState的执行机制
// 文章名称
date
:
2022/3/31 18:00:00
// 文章创建时间
updated:2022/3/28 09:42:24
// 文章更新时间
tags
:
// 文章标签
title
:
探究React中setState的执行机制
date
:
2022/3/31 18:00:00
updated:2022/3/28 09:42:24
tags
:
-
前端
-
JavaScript
author
:
方玉新
// 作者名
author
:
方玉新
---
### 相关的一些问题
...
...
@@ -51,6 +51,8 @@ componentDidMount(){
*
2. 所有组件使用的是同一套更新机制,当所有组件
`didmount`
后,父组件
`didmount`
,然后执行更新
*
3. 更新时会把每个组件的更新合并,每个组件只会触发一次更新的生命周期。
<!-- more -->
1.
2 异步函数和原生事件中的
`setstate`
?
在
`setTimeout`
中调用
`setState`
(例子和在浏览器原生事件以及接口回调中执行效果相同)
```
javascript
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment