Match-id-dd619e8d054f2fd3bac30ca85925d001505434ee

This commit is contained in:
* 2022-04-27 15:57:44 +08:00 committed by *
parent 580beb2ca6
commit 90ab25303d
3 changed files with 0 additions and 3 deletions

View File

@ -3,7 +3,6 @@ import {EffectConstant} from './EffectConstant';
export interface Hook<S, A> {
state: Reducer<S, A> | Effect | Memo<S> | CallBack<S> | Ref<S>;
hIndex: number;
type?: 'useState' | 'useRef' | 'useReducer';
}
export interface Reducer<S, A> {

View File

@ -87,7 +87,6 @@ export function useReducerForInit<S, A>(reducer, initArg, init, isUseState?: boo
}
const hook = createHook();
hook.type = isUseState ? 'useState' : 'useReducer';
// 为hook.state赋值{状态值, 触发函数, reducer, updates更新数组, 是否是useState}
hook.state = {
stateValue: stateValue,

View File

@ -12,7 +12,6 @@ export function useRefImpl<V>(value: V): Ref<V> {
if (stage === HookStage.Init) {
hook = createHook();
hook.state = {current: value};
hook.type = 'useRef';
} else if (stage === HookStage.Update) {
hook = getCurrentHook();
}