Skip to content

ThunkAction is not assignable to parameter of type 'AnyAction'. #333

Closed
@mendesbarreto

Description

@mendesbarreto

Bug Report

Package name / version

[email protected]

Description

I am trying to use a simple method from my store:

store.dispatch(ThunkAction);

It is working on run time, but I am receiving an error message on Typescript:

TS2345: Argument of type 'ThunkAction<Promise<AuthorizationDto | null>, State, unknown, SetAuthorizationAction>' is not assignable to parameter of type 'AnyAction'.   Property 'type' is missing in type 'ThunkAction<Promise<AuthorizationDto | null>, State, unknown, SetAuthorizationAction>' but required in type 'AnyAction'. 

I already tried to import the extend-redux like that:

import 'redux-thunk/extend-redux';

But the problem is the run time does not find file =S.

Screen Shot 2022-04-13 at 3 36 16 PM

I already tried every single solution that's I found on the previous issues, but non of them worked for me.

Steps to reproduce

  • Install the redux-thunk using "npm install"
  • Create a ThunkAction
  • Call the store.dispatch(ThunkAction)
  • See typescript Type error

Expected behavior

No error message from typescript when using store.dispatch(ThunkAction)

Environment

  • OS: macOS Monterey 12.3.1
  • Node/npm version: node v16.14.2 / npm 8.5
  • Platform: React Native iOS/Android

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions