Cannot read property '.then' of undefined when testing async action creators with redux and react

后端 未结 4 1326
执念已碎
执念已碎 2020-12-29 22:38

I\'m trying to write some test using react, redux-mock-store and redux, but I keep getting and error. Maybe because my Promise has not yet been resolved?

<
4条回答
  •  情深已故
    2020-12-29 23:12

    I also know this is an old thread but you need to make sure you return the async action inside of your thunk.

    In my thunk I needed to:

    return fetch()
    

    the async action and it worked

提交回复
热议问题