I am just trying to map nested values inside of a state object. The data structure looks like so:
I want to map each milestone name and then all tasks insid
You can use nested maps to map over the milestones and then the tasks array:
render() {
return (
{Object.keys(this.state.dataGoal.milestones).map((milestone) => {
return (
{this.state.dataGoal.milestones[milestone].tasks.map((task, idx) => {
return (
//whatever you wish to do with the task item
)
})}
)
})}
)
}