There is a Json with data
{ "food": { "food1": { "id": 1, "name": "Каша", "qty": "3" } , "food2": { "id": 2, "name": "Рис", "qty": "21" } } } And the logic that goes through the data and renders it.
import React, { Component } from 'react'; import data from './food.json'; class App extends React.Component { render() { const template = Object.keys(data.food).map(item => <div> <div key={data.food[item].id}>{data.food[item].name} </div> <div>{data.food[item].qty} порций</div> </div> ) return( <div className="hello" style={{color: 'red'}}> {template} </div> ); } } export default App; As during the cycle, you can check the number of portions and, depending on this, change the content of <div>{data.food[item].qty} порций</div> to the desired 1 portion, for example