const Pokemon = (props) =>{ const pokemonName = props.pokemonName; const [pokemon, setPokemon] = useState(0); useEffect(() => { axios.get("https://pokeapi.co/api/v2/pokemon/".concat(pokemonName)) .then(res => { setPokemon(res.data); console.log(pokemon); }) }) if(pokemon) { return(
{"ID #" + pokemon.id}
pokemonImage
); } else { return(
ID #00000
) } }