score:1
Accepted answer
you would have to iterate over that array. if that list accepts map
then something like this should work, i guess:
case types.some_type: {
const lst = state.outputlist.map((el) => {
return update(el, { propertyiwanttochange: {$set: action.value}}
});
return update(state, { outputlist: {$set: lst}})
}
Source: stackoverflow.com
Related Query
- Iterate over array and change a certain property using Immunity Helper for a Redux Reducer
- How do I iterate over an array of objects match a common element from another array and return the key value for "name"
- Change all cell values in table column, already using 2D array for row and cell
- I iterate over an array with map and then try to change a boolen of an object from false to true with an onClick. UI doesn't reflect it but log does
- Passing array of objects to the List component as props and iterate it using map method. But getting error: Cannot set property 'props' of undefined
- For ReactJS, how is the change from using Container components and Presentation components to using Hooks?
- How do i iterate over an array of object in react.js and add the values of prices in the object as shown below
- How can I iterate over the list of URLs and make a call to the server using useSWR hook
- Is there a way to map over the cities on my cities array using the api and rendering the info from all cities on the array?
- Using D3, how to iterate over a non-uniform matrix (of categories) and draw rectangles based on category-color map?
- How to loop over images array and render them in a component for React?
- How to iterate through array of objects and execute a request using react?
- Iterate over array of object using map till the second last object
- How to change places in an Array using React and useEffect?
- Need a solution to fetch data from array and then push it to state using for each
- Grouping array by same property value, iterate over that array
- How to find the count of some object property in array of objects using react and javascript?
- Yup schema generator for form array and nested form groups using Formik, Material-UI - React
- How to correctly iterate over and object in array thats contained with in an array
- How to change color for the numbers based on its value using javascript and react?
- Change a property of one object in an array of objects using setState (React)
- How to add an object to an array only if certain condition is true using typescript and react?
- how to sort an array by string and number and date property using reactjs?
- React useEffect and iterating over array using Vimeo API
- Loop through two array and based on condition change the property value not working
- Javascript : print property "name" and "value" in each object in an array using map
- iterate over array of objects and fetch only specific key to form a new array of object in react js
- How to iterate over an array of object and show only the latest value in a child component?
- Map over TypeScript array of 2 different types with a condition for a property that only exists on one Type?
- Map over an object array and display another element at a certain position
More Query from same tag
- Testing mouse event listener added using ref in React functional component
- How to have a custom internal server error using react next? (500 internal server error)
- Why my usestate hook value is not updating after onClick event with no error at all?
- REACT-SELECT defaultValue in CustomDropdown not working
- React ref for a react element passed as a prop, dynamic event
- How can I pass random prop from api to another component?
- State is not updating in use-effect || data is being fetch but not update state || locally it's fetching data and update without hooks
- Nested Routing is not displaying the right Component
- Array of Objects with one of the fields being a React component?
- How to use Webpack Module Federation plugin with create-react-app without ejecting
- Mapbox react - Display route with adjustments to nearest road using list of location points
- addEventListener on React - Cookie Pop Up Bar
- In which case react key prop warning can be ignored
- filtering array based on each letter from input
- jsx if else shorthand to hide element
- Redux Async Thunk, API keeps responding with pending
- How to update responsive AdSense ad using React without refreshing site
- React Redux - how to derive and then aggregate data in mapStateStateToProps using a selector?
- React not finding events
- ReactJS form validation when state is not immediately updated
- Changing URL onClick in ReactJS
- Typescript/React `<span>Text</span>`only writes out the text and not element
- Sorting an array in React after every click issue
- Empty Dependencies with useMemo or useCallback VS useRef
- JSON api data not loading in React
- How do I display prettyprinted JSON in a React component?
- Sort Products in context doesnt update in my components
- How to generate a PDF File (just as a File) using html2pdf
- Difference between useRef and normal variable
- Next.js & React - Google Tag Manager "Page view" trigger won't fire on every page