score:0

Accepted answer

loginuser() is a "thunk". that means that it's actually passing a function to the real store.dispatch(), and is not a plain action object.

make sure that you've actually included the redux-thunk middleware as part of your store setup process - that teaches the store to accept passing functions to store.dispatch(). see the posts what the heck is a "thunk"? and thunks in redux: the basics for explanations on what this means.

also, as a side note, you can simplify that file a bit. connect supports an "object shorthand" for defining mapdispatch - you can pass an object full of action creators directly, like:

const mapdispatch = {loginuser};

Related Query

More Query from same tag