title: How to get details info about pokemons in pokeAPI
body: <p>I recently started to learn react. I am making a pokedex app with pokeAPI.
  On the card I need to get the type of each pokemon. Below is an example of how I get and save pokemon data.</p>
  
  <pre><code> useEffect(() =&gt; {
      const endpointForPokemonInfo = `${pokemonUrl}`;
      fetchPokemon(endpointForPokemonInfo); // eslint-disable-next-line
    }, []);
  
    const fetchPokemon = endpointForPokemonInfo =&gt; {
      fetch(endpointForPokemonInfo)
        .then(result =&gt; result.json())
        .then(result =&gt; {
          setPokemon([...Pokemon, result.results]);
        }, setLoadingForPokemon(false))
        .catch(error =&gt; console.error("Error:", error));
    };
  </code></pre>
  
  <p>This is example how I display type of pokemon.</p>
  
  <pre><code>      {Pokemon &amp;&amp;
          Pokemon.map((types, id) =&gt; (
            &lt;React.Fragment key={id}&gt;
              &lt;div
                style={{
                  color: "#333",
                  padding: 5,
                  maxWidth: 100,
                  display: "inline-block"
                }}
              &gt;
                {types.type.name}
              &lt;/div&gt;
            &lt;/React.Fragment&gt;
          ))}
  </code></pre>
  
  <p>I don’t know what the problem is, but it throws an error.</p>
  
  <pre><code>Uncaught TypeError: Cannot read property 'type' of undefined
      at GridCards.js:50
      at Array.map (&lt;anonymous&gt;)
      at GridCards (GridCards.js:46)
      at renderWithHooks (react-dom.development.js:14803)
      at updateFunctionComponent (react-dom.development.js:17034)
      at beginWork (react-dom.development.js:18610)
      at HTMLUnknownElement.callCallback (react-dom.development.js:188)
      at Object.invokeGuardedCallbackDev (react-dom.development.js:237)
      at invokeGuardedCallback (react-dom.development.js:292)
      at beginWork$1 (react-dom.development.js:23203)
      at performUnitOfWork (react-dom.development.js:22154)
      at workLoopSync (react-dom.development.js:22130)
      at performSyncWorkOnRoot (react-dom.development.js:21756)
      at react-dom.development.js:11089
      at unstable_runWithPriority (scheduler.development.js:653)
      at runWithPriority$1 (react-dom.development.js:11039)
      at flushSyncCallbackQueueImpl (react-dom.development.js:11084)
      at flushSyncCallbackQueue (react-dom.development.js:11072)
      at scheduleUpdateOnFiber (react-dom.development.js:21199)
      at dispatchAction (react-dom.development.js:15660)
      at GridCards.js:23
  </code></pre>
  
  <p>If I <code>console.log(result)</code> or <code>console.log(...Pokemon)</code>, console shows this result</p>
  
  <p><a href="https://i.stack.imgur.com/sPp9f.png" rel="nofollow noreferrer">console.log(result)</a></p>