I am trying to map JSON from an API call to a return using bootstrap. I want the name to map over one by one to all the columns and rows until all the data has been displayed. Currently, it is mapping all the data(names) in all 3 columns.
componentDidMount() {
fetch(API + 'ts=' + date + 'apikey=' + pubKey + 'hash=' + hash)
.then(res => res.json())
.then(
(result) => {
this.setState({
isLoaded: true,
char: result.data.results,
});
},
(error) => {
this.setState({
isLoaded: true,
error
});
}
)
}
render() {
const { error, isLoaded, char } = this.state;
return (
char.map(char =>
<Container>
<Row>
<Col md="4"> <h2>{char.name}</h2></Col>
<Col md="4"> <h2>{char.name}</h2></Col>
<Col md="4"> <h2>{char.name}</h2></Col>
</Row>
</Container>
)
)
}
}