Skip to content

Commit 1e8fd5b

Browse files
authored
Merge pull request #35 from bestlyg/fix-lyg-dispatch
fix: dispatch
2 parents d4cf6b6 + 92c9d3c commit 1e8fd5b

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

packages/react-reconciler/src/updateQueue.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Disptach } from 'react/src/currentDispatcher';
1+
import { Dispatch } from 'react/src/currentDispatcher';
22
import { Action } from 'shared/ReactTypes';
33
import { Update } from './fiberFlags';
44
import {
@@ -19,7 +19,7 @@ export interface UpdateQueue<State> {
1919
shared: {
2020
pending: Update<State> | null;
2121
};
22-
dispatch: Disptach<State> | null;
22+
dispatch: Dispatch<State> | null;
2323
}
2424

2525
// 创建

packages/react/src/currentDispatcher.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { Action } from 'shared/ReactTypes';
22

33
export type Dispatcher = {
4-
useState: <T>(initialState: (() => T) | T) => [T, Disptach<T>];
4+
useState: <T>(initialState: (() => T) | T) => [T, Dispatch<T>];
55
useEffect: (callback: (() => void) | void, deps: any[] | void) => void;
66
};
77

8-
export type Disptach<State> = (action: Action<State>) => void;
8+
export type Dispatch<State> = (action: Action<State>) => void;
99

1010
const currentDispatcher: { current: null | Dispatcher } = {
1111
current: null

0 commit comments

Comments
 (0)