score:0
export function resetactiontype() {
return dispatch => {
dispatch({
type: 'reset_action_type',
});
};
}
this syntax is used if you setup redux-thunk middleware. the purpose of redux-thunk to make the async request and once the request is resolved, it dispatches the response data. that is why dispatch
is passed an argument. since you have no async code inside action creator, you must return a plain object.
when you connect to the store, dispatch already will call that action generator.
connect(mapstatetoprops, { youractioncreator })(component);
Source: stackoverflow.com
Related Query
- Redux thunk - Error · Actions must be plain objects. Use custom middleware for async actions even with dispatch an object with key type
- Redux Error Actions must be plain objects. Use custom middleware for async actions
- React-Redux: Actions must be plain objects. Use custom middleware for async actions Error
- 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 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
- Redux Thunk + Axios "Actions must be plain objects. Use custom middleware for async actions."
- Actions must be plain objects. Use custom middleware for async actions Saga thunk I do have so far in my store
- 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
- react & redux with hooks: Actions must be plain objects. Use custom middleware for async actions
- Actions must be plain objects. Use custom middleware for async actions even thunk installed
- React redux Actions must be plain objects. Use custom middleware for async actions
- Async Action Redux Unhandled Rejection (Error): Actions must be plain objects. Use custom middleware for async actions
- Error server Error: Actions must be plain objects. Use custom middleware for async actions
- Actions Must be plain objects. Use Custom middleware for async actions when I already have thunk
- 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-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
More Query from same tag
- Why isn't useReducer state rendering new data successfully requested from API?
- I'm getting errors using braintree: ValidationErrorsCollection
- How to do conditional rendering in react with combining components
- Defining React-Redux dispatch as generic function property throws error with typescript 3.1.3
- Not simulating 'change' using enzyme
- Promise<IDropdownOption[]> to <IDropdownOption[]>
- cannot read property of undefined when initialize state in react
- Tailwindcss scrollbar not displaying
- react-select prevent menu to open onInputChange
- Is there a way to use p5.js in a react native app?
- React Typescript: Pass function as props with arguments
- TypeError: Invalid attempt to spread non-iterable instance and Synthetic Events
- How to post data through API (ExpressJS) (ReactJS)?
- What is the easiest way to add <a> tag to a <h1> tag in React?
- How can I export static HTML pages from next.js when they need data from a third-party API?
- How do I get this React form to render onto my page?
- React router 4, path with parameter
- React.js -- input field -- losing focus when typing letters "c" or "n"
- reactjs-popup didn't open as ever after closeOnDocumentClick event triggered
- Sorting and then filtering JSON data into separate components
- React Leaflet: Failed to load sourcemap
- How to avoid global state in React applications?
- react-google-maps align MarkerWithLabel horizontally
- update the specific item in map loop
- Display Json data in specific cells of a table in ReactJS
- React draft wysiwyg - Can't able to type text in editor after clearing editorState
- Why can I assign unknown properties to literal object in typescript?
- How can I use a button to change the Theme for material UI on my site? this is where I am so far
- Not sure what to put in callback function for routing with express and react front end
- Send audio from ReactMediaRecorder to a server