diff --git a/packages/plugins/src/dva.ts b/packages/plugins/src/dva.ts index 7e5a3fa7093b..2a3845d6fbe9 100644 --- a/packages/plugins/src/dva.ts +++ b/packages/plugins/src/dva.ts @@ -201,7 +201,7 @@ interface EffectsCommandMap { interface Action { type: T } -export type Reducer = (prevState: S, action: A) => S; +export type Reducer = (prevState: S, action: A) => ${api.config.dva?.immer? 'S | void' : 'S'}; export type Effect = (action: AnyAction, effects: EffectsCommandMap) => void; type EffectType = 'takeEvery' | 'takeLatest' | 'watcher' | 'throttle'; type EffectWithType = [Effect, { type: EffectType }];