Create a list of Pokemon with the data from 'PokeAPI'
- A component Pokemon in a component PokemonList without API call.
- In PokemonList, I use fetch to call the API with the URL https://pokeapi.co/api/v2/pokemon and get a response which I display in the console.
- In PokemonList, I use then to specify what function should be executed when the browser receive the PokeApi response. We use the json() response method to make it an object.
- In PokemonList, I create a State with an attribute pokemons with the value [ ] by default.
In my API call I change the value of pokemons with setState after I got my JSON response. I log this.state.pokemons in render or I use react inspector to see state change. - I create a list with .map() on my array pokemons from state, and I use props to get my pokemon name in the component Pokemon.