I am working with react I want to show some dynamic content on UI but unable to loop the data as I am newbie so finding this difficult to do
state={
dashboardManpowerCount:{
"CurrentMonth": {
"Total No of employes": 25,
"Ariving": 10,
"Exited": 8
},
"PreviousMonth": {
"Total No of employes": 25,
"Ariving": 10,
"Exited": 8
}
}
}
class currAndprevMonthcCounts extends Component {
render(){
const {dashboardManpowerCount} = this.state
return(
<div>
<div className="col-6 col-sm-6 col-md-6 col-lg-3 col-xl-3">
<div className="row">
<div className="col-12 col-sm-12 col-md-6 col-lg-5 col-xl-5">
<h6>Previous Month</h6>
<h2>395</h2>
</div>
<div className="col-12 col-sm-12 col-md-6 col-lg-7 col-xl-7">
<span className="badge badge-pill badge-secondary mt-2"
>+7 Ariving</span>
<br></br>
<span className="badge badge-pill badge-secondary mt-3">-3 Exiting</span>
</div>
</div>
</div>
<div className="col-6 col-sm-6 col-md-6 col-lg-3 col-xl-3">
<div className="row">
<div className="col-12 col-sm-12 col-md-6 col-lg-5 col-xl-5">
<h6>Previous Month</h6>
<h2>395</h2>
</div>
<div className="col-12 col-sm-12 col-md-6 col-lg-7 col-xl-7">
<span className="badge badge-pill badge-secondary mt-2">+5 Ariving</span>
<br></br>
<span className="badge badge-pill badge-secondary mt-3">-3 Exiting</span>
</div>
</div>
</div>
</div>
)
}
}
there are two options current month data and previous month data I want to loop through the object and render in place of static content in my jsx
Edit / Update
I think I am missing something here is working example with static data on UI This is what I am trying to get
