title: React: How to solve the error: Object is of type 'unknown'?
body: <p>I'm trying to use the axios in order to fetch data from an API, but the response.data gives me 'unknown' error. Not sure how to fix this. Anyone can help me please. I'm using Typescript.</p>
  <p>This is the error I'm getting:</p>
  <blockquote>
  <p>Object is of type 'unknown'.ts(2571)
  (parameter) response: AxiosResponse&lt;unknown, any&gt;</p>
  </blockquote>
  <pre><code>    interface Props {
    pokemonItem: PokemonItem[];
    children: React.ReactNode | React.ReactNode[];
  }
  
  export const PokemonContainer: React.FC = (props) =&gt; {
    const { pokemonItem } = props;
    const { name, height, weight, abilities } = pokemonItem;
  
    const [hovered, setHovered] = React.useState(false);
    const [imageLoaded, setImageLoaded] = React.useState(false);
    const [pokemon, setPokemon] = React.useState([]);
  
  
    const getPokemons = () =&gt; {
      try {
        axios
        .get('https:pokeapi.co/api/v2/pokemon')
        .then((response) =&gt; {
          setPokemon(response.data.results.map((item) =&gt; item.name));
        });
      } catch (error) {
        console.log(error);
      }
    };
  
    React.useEffect(() =&gt; {
      getPokemons();
    }, []);
  </code></pre>
  <p>in another file I have defined the data types:</p>
  <pre><code>export interface PokemonItem {
  id: number;
  name: string;
  height: string;
  weight: string;
  abilities: string;
  image: string;
  }
  </code></pre>