File tree Expand file tree Collapse file tree 3 files changed +33
-2
lines changed Expand file tree Collapse file tree 3 files changed +33
-2
lines changed Original file line number Diff line number Diff line change 251251- [ React 组件生命周期] ( ./react/组件生命周期.md )
252252- [ React Refs] ( ./react/Refs.md )
253253
254- ### 阶段二(源码)
254+ ### 阶段二
255255
256256- [ JSX到JavaScript的转换] ( ./react/JSX到JavaScript的转换.md )
257257- [ ReactElement] ( ./react/ReactElement.md )
268268- [ 类式组件] ( ./react/类式组件.md )
269269- [ 对state的理解] ( ./react/对state的理解.md )
270270- [ 字符串形式的ref] ( ./react/字符串形式的ref.md )
271-
271+ - [ Update和UpdateQueue ] ( ./react/Update和UpdateQueue.md )
272272
273273## 常见问题及解答
274274
Original file line number Diff line number Diff line change 1+ 用于记录组件状态的改变
2+
3+ 存放在与UpdateQueue中
4+
5+ 多个Update可以同时存在
6+
7+ ``` js
8+ export function createUpdate (expirationTime : ExpirationTime ): Update<*> {
9+ return {
10+ expirationTime: expirationTime,
11+ tag: UpdateState,
12+ payload: null ,
13+ callback: null ,
14+ next: null ,
15+ nextEffect: null ,
16+ };
17+ }
18+ ```
19+
20+
21+
Original file line number Diff line number Diff line change 44
55// 组件内的标签可以定义ref属性来标识自己
66< input ref= " input1" type= " text" / >
7+
8+ class Demo extends React .Component {
9+ showData = () => {
10+ const { input1 } = this .refs
11+ alert (input1 .value )
12+ }
13+ }
14+
15+ // 回调
16+ < input ref= {c => this .input1 = c } type= " text" placeholder= " " / >
717```
You can’t perform that action at this time.
0 commit comments