Redux Promise is convenient for dispatching three actions (request, success, failure) without writing that code manually.
Redux Thunk is convenient for async data flow when you express one action creator as waiting for another action creator. It also lets you read the current state for conditional dispatches and early bailouts.
You can use them together, or use any one in particular. I would recommend starting with Redux Thunk because it offers more control and is more versatile. After you get it working, you can consider adding Redux Promise to remove some of the boilerplate code related to dispatching three kinds of actions. If you find that it doesn’t buy you much, remove it. On the other hand, if you notice all you thunk action creators just dispatch a single promise, you can remove Redux Thunk instead.
If this is still confusing, I recommend just using Redux Thunk until you get more comfortable with how middleware works.
- What are the differences between Redux-Thunk and Redux-Promise when used with Axios apis?
- React functional stateless component, PureComponent, Component; what are the differences and when should we use what?
- What is the difference between .ts and .tsx extensions. Both are used as extensions for typescript files in react. So where should we use them?
- What are the differences when re-rendering after state was set with Hooks compared to the class-based approach?
- What is the difference between Redux Thunk and Redux Saga?
- What are the main differences between AngularJS and ReactJS
- What are the differences between plain es6 class and extend React.Component
- what is the best way to use react router V6 navigation with redux and redux thunk actions?
- What are the internal implementation differences between PureComponent and Component in React?
- What are the differences between the code wrapped in useEffect(fn, ) and the code outside useEffect(fn, )?
- What are the differences between defaultValue and value in select?
- What does it mean when there are two functions with the 'arrow function indicator' between them?
- What are the differences between useEffect versus componentDidMount/componentWillUnmount? What are the differences between hooks and this.setState?
- What is the necessity of "export default connect" when you are connecting your react component to redux store
- StyledComponents with Typescript and ThemeProvider. What are the right types?
- What is the purpose of having two running ports when we working with ReactJS and NodeJS?
- ES6 React - What are the difference between reference, shallow copy and deep copy and how to compare them?
- What are the benefits of using thunk middleware in redux over using regular functions as async action creators?
- Redux saga: What is the difference between using yield call() and async/await?
- How to optimize React components with React.memo and useCallback when callbacks are changing state in the parent
- What is the difference with using ref and document.getElementById, ect when using ReactJS?
- What are the difference between reactJS props and refs?
- What is the difference between [...arr, addThisElement], and arr.push(addThisElement) when using useState in ReactJS?
- What are the difference/similarities between React (app framework from Facebook) and react.js (reactive extensions for JS)?
- Confused between the difference between JSX.Element vs React.Component and when to use them with React-dom-router
- What is the proper way to escape quotes and slashes when running a Jest test with --collectCoverageFrom from Powershell via npm scripts?
- When and what part of the state is supposed to be deep cloned in Redux reducer?
- What is the different between classes prop in mui and className prop when you insert style in to them?
- How to define TypeScript types when used with React useState and the previous state inside a state updating function?
- What is the correct way to React Hook Fetch Api and store to Redux and retrieve it with Selector immediately?
More Query from same tag
- React Redux will not reset store of some component
- D3 brush lag when moving
- React-Router-Redux dispatched LOCATION_CHANGE twice, remove search value
- Apply Dynamic Item Style To React FullCalender
- Rendering CSS transition when React element's text changes
- Meteor method called from React components responce and error callbacks are always undefined?
- TypeError: Cannot read property 'title' of undefined React JS
- React/Express: POST error 413: Payload too large (Bodyparser does not work)
- How to call a method of a functional react component from another functional react component?
- Iterating a json with nested objects and filtering depending on attributes values
- how can I store and access data attributes on elements like select options in React
- How to display submenu links in React
- React getting response from axios in component
- Style html elements dynamically based on id
- Integrating bpmn-js to modeler the react component
- How to test a React component that has Router, Redux and two HOCs... with Jest and Enzyme?
- How to validate input[type="date] in React?
- How to disable eslint errors showing in the browser
- Close menu when clicking outside the React component
- Immutablejs and shouldComponentUpdate
- How can I change Checkbox's Icon using Ant Design?
- Change constructor properties in ReactJS
- How to add a checbox at the starting of every row in react-virtualized table?
- How to call a click event on react geo chart?
- Massive spike in YouTube Data API queries
- Is there a way I can filter array within another filter scope
- Error when use tabIndex in Autocomplete of MUI
- How to save a list of json data that i get from an API to a class property using fetch
- User roles: node.js express sequelize react.js
- React, onClick only works after second click, Axios, Async/Await