I'm having this error:
TS2345: Argument of type '(dispatch: Dispatch) => Promise<void>' is not assignable to parameter of
type 'AnyAction'. Property 'type' is missing in type '(dispatch: Dispatch) => Promise<void>' but
required in type 'AnyAction'. type' is declared here* :
* The code of the declaration is:
export interface Action<T = any> {
type: T
}
AnyAction extends Action.
This is my code on the test:
import configureStore from 'redux-mock-store';
import reduxThunk from 'redux-thunk';
// some code, then in the test I have:
const mockStore = configureStore([reduxThunk]);
const store = mockStore({});
store.dispatch(signIn()); //here I have the error
The definition of signIn is:
export const signIn = () =>
async (dispatch: Dispatch): Promise<void> => {
dispatch({
type: SIGN_IN_REQUEST
});
};
Any hint or idea on how to fix it?