class App extends Component {
state = {
users: []
}
componentDidMount() {
fetch('https://jsonplaceholder.typicode.com/users')
.then(response => response.json())
.then(users => this.setState({ users }));
}
render() {
return(
<div className="App">
<table>
<tbody>
{this.state.users.map(n => (
<tr key={n.id}>
<td>{n.name}</td>
<td>{n.username}</td>
<td>{n.email}</td>
<td>{n.website}</td>
</tr>
))}
</tbody>
</table>
</div>
)
}
}