-
-
Notifications
You must be signed in to change notification settings - Fork 15.2k
Closed
Description
Redux: 3.6.0
Typescript: 2.3.3
compilerOptions.noImplicitAny is set to true.
Redux has next definitions.
export interface Action {
type: any;
}
export type Reducer<S> = <A extends Action>(state: S, action: A) => S;Reducer:
interface AuthReducerState {
user?: {
id: number;
email: string;
};
}
export const authReducer: Reducer<AuthReducerState> = (state, action) => {
switch (action.type) {
default:
return state;
}
};Errors:
TS7006: Parameter 'state' implicitly has 'any' type.
TS7006: Parameter 'action' implicitly has 'any' type.
If definitons would have been changed it would solve problem.
export interface Action {
type: string;
[key: any]: any;
}
export type Reducer<S> = (state: S, action: Action) => S;Please explain what I do wrong.
luchillo17
Metadata
Metadata
Assignees
Labels
No labels