File tree Expand file tree Collapse file tree 3 files changed +5
-7
lines changed Expand file tree Collapse file tree 3 files changed +5
-7
lines changed Original file line number Diff line number Diff line change 6
6
- 💪 功能完备,当前可跑通官方测试用例数量:34
7
7
- 🚶 按` Git Tag ` 划分迭代步骤,记录从 0 实现的每个功能
8
8
9
- 如果想跟着我学习「如何从0到1实现React18」,可以购买如下课程:
10
-
11
- <img width =" 200 " src =" https://user-images.githubusercontent.com/15828041/204089108-eaccf461-1521-4a68-bcd1-d04aef1bd6ad.png " alt =" 卡颂 " />
9
+ 如果想跟着我学习「如何从0到1实现React18」,可以[ 点击这里] ( https://qux.xet.tech/s/2wiFh1 )
12
10
13
11
14
12
## TODO List
Original file line number Diff line number Diff line change 1
- import { Disptach } from 'react/src/currentDispatcher' ;
1
+ import { Dispatch } from 'react/src/currentDispatcher' ;
2
2
import { Action } from 'shared/ReactTypes' ;
3
3
import { Update } from './fiberFlags' ;
4
4
import {
@@ -19,7 +19,7 @@ export interface UpdateQueue<State> {
19
19
shared : {
20
20
pending : Update < State > | null ;
21
21
} ;
22
- dispatch : Disptach < State > | null ;
22
+ dispatch : Dispatch < State > | null ;
23
23
}
24
24
25
25
// 创建
Original file line number Diff line number Diff line change 1
1
import { Action } from 'shared/ReactTypes' ;
2
2
3
3
export type Dispatcher = {
4
- useState : < T > ( initialState : ( ( ) => T ) | T ) => [ T , Disptach < T > ] ;
4
+ useState : < T > ( initialState : ( ( ) => T ) | T ) => [ T , Dispatch < T > ] ;
5
5
useEffect : ( callback : ( ( ) => void ) | void , deps : any [ ] | void ) => void ;
6
6
} ;
7
7
8
- export type Disptach < State > = ( action : Action < State > ) => void ;
8
+ export type Dispatch < State > = ( action : Action < State > ) => void ;
9
9
10
10
const currentDispatcher : { current : null | Dispatcher } = {
11
11
current : null
You can’t perform that action at this time.
0 commit comments