score:1
Accepted answer
This answer might not be perfect but you can do it like so.
{this.state.data.map(item => {
if (item.period === 'YTD') {
Return <div>{item.gross}</div>
}
This is an example of Using map to reformat objects in an array
Like Mozilla https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map
Source: stackoverflow.com
Related Query
- How can I filter json data from api call in react into different sections of the component
- How can I use response data from an API to call another different API request in React UseEffect?
- How to filter JSON data from API and setState in React
- How to filter the data from an API in a ethical way? Im using react JS
- I do not know how to store json data from an api call within a nodejs express server, and send it to a react native client
- React - How can I pass API data from one component to another in a different js file?
- How can I turn the data that is a image came from API to url to use in img tag in react Js
- How can I insert a variable from the React context API into a placeholder?
- How do I get the data from an API call, in a different file, in React
- how can i send an api call from the supreme function to another component called product to change a mock data called cart: true and display in cart
- How can I convert the data from an API url into an array in React?
- Set the data in React Context from asynchronous API call
- How can I get data from a local file into my React app?
- React Select - How to show / iterate through data from api call in option instead of hardcoding options?
- How can I cache data that I already requested and access it from the store using React and Redux Toolkit
- How can I reuse the API data for all the pages in react js
- How can I cache data from API to Cache Storage in React PWA?
- How can I use react useContext , to show data from context, in the same component
- React useEffect calls API too many time, How can I limit the API call to only once when my component renders?
- REACT JS How can I display my fetched API data from onClick?
- How can I make a request to an API based on the response from another request? React Hook "useSwr" cannot be called inside a callback
- React is not updating the UI after receiveing data from the API call (using hooks)
- How can I render API data into separate tables based on the value in React?
- How to pass data from React client into the Oauth2.0 Google strategy flow with passport.js
- How can I get the right data from database with react
- How to store data from json API response into array in ReactJS?
- How to display data from the api in react
- How can I bind data from the API in react?
- How to fetch json data from a url that requires an api key to access the data in reactjs?
- reactJS How can I add a search filter for data from the db
More Query from same tag
- Focus field when removing part of form dynamically in ReactJs
- How to make reactstrap modal with dynamic content resizable and draggable?
- Webpack not recognizing firebase.initializeApp() function
- Next and previous buttons not working properly
- Change the size of a checkbox with Material UI
- How can I set React component state based on previous state using Immer?
- React - on form submit get POST params
- Custom react hook to for text field seems to be broken
- How to get current route from outside in react-router?
- Show modal based on post id
- Toggle Visibility of an Uncontrollable Element in React
- Project deployed on heroku works wrong with routes
- React Props not being returned, but being returned in console
- this.refs no longer available in componentDidMount?
- Different output fetching json with and without arrow function on reactjs
- Where should I use act when testing an async react hook?
- Render multiple React components in shorthand if condition
- Threejs TorusGeometry Group error : THREE.Object3D
- Union type assignment issue with React/Redux/Typescript setup
- ReactJS Javascript - Dynamic Add / Remove Rows of Input in Form
- Type 'MouseEvent<HTMLButtonElement, MouseEvent>' is not assignable to type 'boolean'
- Browserify including entire module when only some parts used (react-addons)
- How to test a component that isn't exported in React
- Create a Material Ui checkbox with textfiled
- Unit testing image tag with image object
- How to style the same component in multiple ways using CSS Modules in React?
- Displaying a Facebook Auth photoURL in React
- Build Failure while using webpack production build
- Type 'Element' is missing the following properties from type 'ButtonProps': className, content
- Why does React Router v6 seem unable to remove query string param from URL?