score:0
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};
Source: stackoverflow.com
Related Query
- React-Redux: Actions must be plain objects. Use custom middleware for async actions Error
- Redux Error Actions must be plain objects. Use custom middleware for async actions
- Redux thunk - Error ยท Actions must be plain objects. Use custom middleware for async actions even with dispatch an object with key type
- I'm using a useDispatch custom hook and getting this error in my test: Actions must be plain objects. Use custom middleware for async actions
- Error: Actions must be plain objects. Use custom middleware for async actions. React-redux error
- Error server Error: Actions must be plain objects. Use custom middleware for async actions
- Use custom middleware for async actions. Actions must be plain objects
- Error - Actions must be plain objects. Use custom middleware for async actions
- what is this error message for ? Actions must be plain objects. Use custom middleware for async actions
- React-Redux: Actions must be plain objects. Use custom middleware for async actions
- Unit test: Actions must be plain objects. Use custom middleware for async actions
- CreateAsyncThunk Error: Actions must be plain objects. Use custom middleware for async actions
- React-Redux-Saga: Actions must be plain objects. Use custom middleware for async actions
- React-Redux - Unhandled Rejection (Error): Actions must be plain objects. Use custom middleware for async actions
- Actions must be plain objects. Use custom middleware for async actions.how to solve this
- react-redux Error: Actions must be plain objects. Use custom middleware for async actions
- Redux Actions must be plain objects. Use custom middleware for async actions
- React Redux Saga: Actions must be plain objects. Use custom middleware for async actions
- redux-observable + socket.io: Actions must be plain objects. Use custom middleware for async actions
- Error: Actions must be plain objects. Use custom middleware for async actions.
- Actions must be plain objects. Use custom middleware for async actions - Lost Here
- Actions must be plain objects. Use custom middleware for async actions
- How to fix: Error: Actions must be plain objects. Use custom middleware for async actions.?
- Redux-Thunk Error: Actions must be plain objects. Use custom middleware for async actions
- Redux error: Actions must be plain objects. Use custom middleware for async actions
- Problem with redux middleware - Error: Actions must be plain objects. Use custom middleware for async actions
- Error: Actions must be plain objects. Use custom middleware for async actions. But I don`t have async functions
- React/Redux: Error: Actions must be plain objects. Use custom middleware for async actions
- Can't beat the "Actions must be plain objects. Use custom middleware for async actions." error while trying to follow redux.js.org tutorial
- React-Reudx: Actions must be plain objects. Use custom middleware for async actions
More Query from same tag
- Need help on getting data from API with axios
- REACT DROPZONE: Get data:images after upload
- React-redux: mapDispatchToProps does not dispatch action
- Conditionally importing npm modules?
- React.js State not updating in Event Listener in useEffect Hook
- Refresh table after post in react
- Migration to material-ui v4, I get warning for Modal component
- Jsx Component not showing after conditional checks
- Flux + React: when to keep state of visual components at store
- Deprecated Warning: Deep requiring like const uuidv5 = require('uuid/v5'); is deprecated as of uuid@7.x in node js
- String to React DOM object
- react-data-grid x-axis scroll issue
- Unable to get socket event in ReactJS from XMPP Strophe
- React Native - Difference between onChangeText and onSubmitEditing?
- react-redux app: returning a redux prop in jsx
- defaultProps should be declared outside the class body
- Callback not correctly updating state (ReactJS)
- react-graph-vis - Grapg is not re rendering even ofter state changes
- How to implement plugin-based architecture using redux
- Pass setState as a callback to another setState
- How to increase/decrease count on click of same button in Js/ReactJs
- React Hooks useState array storage problem
- How to debug err: "Uncaught (in promise) Missing Argument Unit"
- How to gracefully render React.js Components with ajax
- Passing Proptypes.shape to Proptypes.arrayOf in react
- How to delete element in array after socket event in React?
- MongoDB aggregate lookup not working with multiple parameters
- Pass props to every component
- setInterval in React - unexpected behavior
- TypeScript: Object is possibly 'null'