title: React.js - Can't fetch API
body: <p>I am trying to build an API website for my portfolio using the NASA Image and Video Library API. When I type in the fetch in my browser (<a href="https://images-api.nasa.gov/search?q=%22%22" rel="nofollow noreferrer">https://images-api.nasa.gov/search?q=%22%22</a>), the collection pops up. Yet when I try to fetch it in React.js, nothing shows!</p>
  
  <p>I've tried axios, and trying different searches, using state and consts, and the fetch never gives me anything.</p>
  
  <p>Here is my App code, please help if you can I'm so excited to make this website but I can't get past this bug:</p>
  
  <pre><code>    import React from 'react';
  import './App.css';
  import {
    BrowserRouter as Router,
    Switch,
    Route,
    Link
  } from "react-router-dom";
  import Test from "./components/test";
  import axios from "axios";
  
  
  export default function App() {
  
    const [data, setData] = React.useState([]);
  
    async function getData() {
      await fetch("https://images-api.nasa.gov/search?q=apollo")
      .then(res =&gt; setData([res]));
  
    }
  
    return (
      &lt;Router&gt;
      &lt;Switch&gt;
        &lt;Route exact path="/"&gt;
          &lt;ul&gt;
            {data}
          &lt;/ul&gt;
          {/* LANDING PAGE + Picture of the Day*/}
        &lt;/Route&gt;
        &lt;Route path="/browse"&gt;
          {/* Most Popular Pictures */}
        &lt;/Route&gt;
        &lt;Route path="/mars-rover"&gt;
          {/* Mars Rover */}
        &lt;/Route&gt;
      &lt;/Switch&gt;
      &lt;/Router&gt;
    );
  }
  </code></pre>