score:0
Accepted answer
just add another map when you are assigning to nabua
so it looks like this:
nabua = array.from(new set(nabua.map(p => p._id))).map(id => {
return nabua.find(p => p._id === id);
})
.map(item => ({
field1: item.field1,
field2: item.field2
}));
and make field1
/field2
whatever field you like. so if you want name, description and price, it can look something like this
.map(item => ({
name: item.name,
description: item.description,
price: item.price
}));
Source: stackoverflow.com
Related Query
- Local Storage properties
- Save API token to local storage ReactJS
- React Context Api vs Local Storage
- React - saving state to local storage
- Local storage using redux toolkit
- Which one is more safe local storage or cookies?
- react app local storage is not setting up
- How do I persist state in local storage React without Redux?
- React JS Local Storage update on view change
- NextJS: Get data from local storage in getInitialProps method
- react load local storage at first
- Is it possible to use local storage on heroku?
- Local Storage - React Native
- React Local Storage and Service Worker (Sending Data when you're back online
- How to edit local storage values react?
- How to store into the local storage ? (REACT)
- Call one function after another has set item in local storage
- How do i access the data from a token stored in local storage in react
- How to deal with local storage and SSR?
- How to call a function based on the changes in an array which is linked to the local storage
- React: redux persistence in local storage
- Remove an item from local storage in reactjs
- Assign local storage to react state. React Hooks
- How to clear local storage when deleting user
- ReactJS: How do I pass data from JSON in local storage to a component?
- Best way to check if there is already a token in local storage using use effect in React Context
- Using local storage in ReactJS
- How update local storage in all opened tab
- ReferenceError: localStorage is not defined. Using Local Storage in Nextjs
- NextJS issue reading items already in local storage
More Query from same tag
- React.JS Cannot read property 'props' of null Error
- SO Relay QueryRenderer - TypeError: this.props.render is not a function
- Is it possible to use Array as option in React select
- How to use css clip-path in React JSX
- Enforcing TSX prop type inline for function declaration which declares props using object destructuring
- ReactJS onClick not working on first element in menu
- How to disable file watching in a react app
- How can I pass a function when linking with React Router?
- How do I get props from a onChange() event?
- How to hide a column on Material UI based on certain criteria?
- ReactJS + NodeJS server + Filepond uploading file
- How to convert 'Functional Componenet' to 'Class Component' in React?
- How to build react native project to aar library?
- Unable to loop single react component
- How do I change slate editor value using Javascript (DOM manipulation)
- tests failing in react testing library
- Webpack2-React. Imported classNames do not target the component class after bundling
- Code splitting with create-react-app and react-loadable is not working
- Use a button send a form and href at the same time in react.js
- How to assign response from Api to an array using fetch function
- React js - Show or hide a div
- React App Some CSS Properties Gets Ignored
- What is `_dereq_()` inside React?
- Importing draw2d in react causes jquery reference error
- Number with decimal input in React?
- Trying to access mapped api data and show it in React-big-calendar (ReactJS)
- How do I add a post route to my react application
- How to pass url prop in Route's element
- Gain access to query parameters via React
- Append a component dynamically