import React, { Component } from 'react';

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

export default App;

import React, { Component } from 'react';

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

//const Person = (props) => 

export default App;

Fix missing key in loop
Fix missing key in loop
