score:0
//react-redux method - it doesn't allow dispatch(table({ type: 'set_data', receipts: (data.items[0].receipts), expenditures: (data.items[0].expenditures), bank: (data.items[0].bank), balance: data.items[0].receipts-data.items[0].expenditures }))
it does allow it. what makes you think that it doesn't?
all you need to do is in your reducer, get the correct values from action like this:
case 'set_data':
// return (
// state.receipts = action.payload
// state.expenditures = same
// instead of above, use below
return {
...state,
recipients: action.recipients,
expenditures: action.expenditures,
// ...
};
Source: stackoverflow.com
Related Query
- How to return multiple values in return while using Redux Dispatch?
- React Redux - How to dispatch an action on componentDidMount when using mapDispatchToProps in a connected component
- How to set multiple values at once in react hook form using Typescript
- How can I combine multiple combineReducers functions in Redux using something like immutable.js
- How to dispatch multiple action creators (React + Redux + Server-side rendering)
- Redux action return type when using dispatch and getState
- How to properly mock useSelector hook to return correct values while testing?
- How to pass Dispatch to action when using redux form
- How to return multiple list components using react.js
- React Redux how to dispatch using ownProps route parameter
- How can I check the return value of dispatch in redux hook
- How can I make redux dispatch an action as well as return a promise?
- How to map multiple states to props by using Redux in React?
- How to sum, divide values of multiple inputs using onChange event | ReactJS
- How to filter data using multiple values in React.JS
- How to dispatch redux actions using react-router v4?
- How to initiallize values in a redux form using mapStateToProps from a custom JSON as prop?
- How can I wait for multiple promises to all be done before using their return data for another function call?
- How to get ReactRouter Props , while using Redux
- How to save props or state values without using Redux
- How to dispatch actions via a timer using Redux
- How to get selected values from multiple dropdowns on button click using ReactJs
- How do I unsubscribe to the dispatch to grab new data onload on useEffect? - I'm using Redux Toolkit
- How to dispatch action when a state changes in redux toolkit without using useEffect?
- How to dispatch an action just if another action was correctly dispatched ? Using redux thunk (react)
- How to sum values of multiple inputs using onChange event | ReactJS
- How to map Multiple dispatch actions to single prop in React Redux
- How to read the content of the file using FleReader while upload multiple file upload in react js
- How to set multiple object values when using Immutable JS map
- How to access multiple returns from the reducer using single subscriber in Redux
More Query from same tag
- Object is of type unknown error when using Typescript with React
- How can I make a variable have the type unknown or 'Movie' assigned?
- Prevent child state resets on props change
- Unable to set the content of the box in an appropraite way using reactjs
- why does useReducer run twice?
- Validation using Yup to check array length --> error if length === 1
- Redux connect chaining async actions
- How to handle click events on divs with React and Typescript
- TypeError: Class extends value undefined is not a constructor or null while running next.js
- React+Redux - Uncaught Error: Expected the reducer to be a function
- Select List not working in ReactJS
- Simple Component is not rendering: React js
- Extending a html component get attributes are not working
- How to Avoid Memory Leak on Screen Size Change in ReactJS
- How to publish a typescript package for both node and react
- Redux - returning an array instead of an object in the reducer
- How to check Checkbox checked in the table or not
- reactjs - Import a dynamic file in render() method
- How to stop onMouseOut event after onClick event (ReactJS)?
- Returning a 404 from an API endpoint in Next.js returning error
- How does a basic data flow works between ReactJS, Apollo Graphql and GRPC, backend
- is this possible to get scroll position in material-ui select list on Scroll?
- How do I return data from multiple APIs to display on one page in React?
- How to apply margin to a div on condition using styled component and react?
- How to improve Webpack performance in Dev Environment?
- How mutate array in GraphQL by Lokka?
- React Redux promise error - (...).then is not a function
- react bootstrap table show empty row
- React state change or page refresh on loading new page
- How do I detect when router path '/' is true?