class App extends Component {
constructor(props) {
super(props);
this.state = {
items: []
};
}
componentDidMount() {
fetch( 'http://swapi.co/api/people/?format=json')
.then( response => response.json() )
.then( ({results: items}) => this.setState({items}))
}
render() {
return (
<div>
{this.state.items.map(item => <h4>{item.name}</h4>)}
</div>
);
}
}
"proxy": "http://localhost:3010",