I got a data from API and it seems like Object data(JSON) Public API Link
import React, { Component } from 'react';
import axios from 'axios';
import './PostContainer.css';
class PostContainer extends Component {
constructor(props) {
super(props);
this.state = { chartData: {} };
}
async componentDidMount() {
let { data: chartData } = await axios.get(
'https://api.bithumb.com/public/ticker/all'
);
this.setState({ chartData });
}
render() {
const { chartData } = this.state;
// chartData.data.date = undefined;
// delete chartData.data.date;
console.log(`DATA ${chartData.data}`);
// for (const val, index in chartData.data) {
// console.log(`${index} : ${val.sell_price}`)
// }
return (
<div className="Post">
<table id="table" className="table table-striped table-bordered">
<thead>
<tr>
<th>Coin Name</th>
<th>Current Price</th>
<th>Volume</th>
</tr>
</thead>
<tbody>
<tr>
<td>{?? What should I enter?}</td>
<td>123123123123</td>
<td>12312312</td>
</tr>
<tr>
<td>ETH</td>
<td>121243123</td>
<td>1231231</td>
</tr>
</tbody>
</table>
</div>
);
}
}
export default PostContainer;
And I want to render all data to table like this.
With console.log, it returned Object like this
But I don't have any idea how to iterate to render the data with these object data. Before when I use Express & NodeJS & Pug environment I use for...in statement and it works well. But in Reactjs with this code
for (const val, index in chartData.data) {
console.log(`${index} : ${val.sell_price}`)
}
It got error like this
Line 24: Parsing error: Unexpected token
I tried lots of another iteration method but it seems not right.


chartDatais array?