title: How do you filter JSON data using axios and useEffect?
body: <p>I want to filter the data from this json file:</p>
  <pre><code>Array(53)
  0: {fips: &quot;02&quot;, country: &quot;US&quot;, state: &quot;AK&quot;, county: null, level: &quot;state&quot;, …}
  1: {fips: &quot;01&quot;, country: &quot;US&quot;, state: &quot;AL&quot;, county: null, level: &quot;state&quot;, …}
  2: {fips: &quot;05&quot;, country: &quot;US&quot;, state: &quot;AR&quot;, county: null, level: &quot;state&quot;, …}
  3: {fips: &quot;04&quot;, country: &quot;US&quot;, state: &quot;AZ&quot;, county: null, level: &quot;state&quot;, …}
  4: {fips: &quot;06&quot;, country: &quot;US&quot;, state: &quot;CA&quot;, county: null, level: &quot;state&quot;, …}
  5: {fips: &quot;08&quot;, country: &quot;US&quot;, state: &quot;CO&quot;, county: null, level: &quot;state&quot;, …}
  6: {fips: &quot;09&quot;, country: &quot;US&quot;, state: &quot;CT&quot;, county: null, level: &quot;state&quot;, …}
  7: {fips: &quot;11&quot;, country: &quot;US&quot;, state: &quot;DC&quot;, county: null, level: &quot;state&quot;, …}
  8: {fips: &quot;10&quot;, country: &quot;US&quot;, state: &quot;DE&quot;, county: null, level: &quot;state&quot;, …}
  9: {fips: &quot;12&quot;, country: &quot;US&quot;, state: &quot;FL&quot;, county: null, level: &quot;state&quot;, …}
  10: {fips: &quot;13&quot;, country: &quot;US&quot;, state: &quot;GA&quot;, county: null, level: &quot;state&quot;, …}
  11: {fips: &quot;15&quot;, country: &quot;US&quot;, state: &quot;HI&quot;, county: null, level: &quot;state&quot;, …}
  12: {fips: &quot;19&quot;, country: &quot;US&quot;, state: &quot;IA&quot;, county: null, level: &quot;state&quot;, …}
  13: {fips: &quot;16&quot;, country: &quot;US&quot;, state: &quot;ID&quot;, county: null, level: &quot;state&quot;, …}
  14: {fips: &quot;17&quot;, country: &quot;US&quot;, state: &quot;IL&quot;, county: null, level: &quot;state&quot;, …}
  15: {fips: &quot;18&quot;, country: &quot;US&quot;, state: &quot;IN&quot;, county: null, level: &quot;state&quot;, …}
  16: {fips: &quot;20&quot;, country: &quot;US&quot;, state: &quot;KS&quot;, county: null, level: &quot;state&quot;, …}
  17: {fips: &quot;21&quot;, country: &quot;US&quot;, state: &quot;KY&quot;, county: null, level: &quot;state&quot;, …}
  18: {fips: &quot;22&quot;, country: &quot;US&quot;, state: &quot;LA&quot;, county: null, level: &quot;state&quot;, …}
  19: {fips: &quot;25&quot;, country: &quot;US&quot;, state: &quot;MA&quot;, county: null, level: &quot;state&quot;, …}
  20: {fips: &quot;24&quot;, country: &quot;US&quot;, state: &quot;MD&quot;, county: null, level: &quot;state&quot;, …}
  
  0:
  actuals: {cases: 65944, deaths: 318, positiveTests: 107163, negativeTests: 2044164, contactTracers: 235, …}
  annotations: {cases: {…}, deaths: {…}, positiveTests: {…}, negativeTests: {…}, contactTracers: {…}, …}
  country: &quot;US&quot;
  county: null
  fips: &quot;02&quot;
  lastUpdatedDate: &quot;2021-04-21&quot;
  lat: null
  level: &quot;state&quot;
  locationId: &quot;iso1:us#iso2:us-ak&quot;
  long: null
  metrics: {testPositivityRatio: 0.030363378437363597, testPositivityRatioDetails: {…}, caseDensity: 22.164440621268295, contactTracerCapacityRatio: 0.28986784140969163, infectionRate: 0.968046978543, …}
  population: 731545
  riskLevels: {overall: 2, testPositivityRatio: 1, caseDensity: 2, contactTracerCapacityRatio: 1, infectionRate: 1, …}
  state: &quot;AK&quot;
  url: &quot;https://covidactnow.org/us/alaska-ak&quot;
  </code></pre>
  <p>How can I use axios and React Hooks to filter this data and only get the state name and their actuals as variables to pass in a search UI later?</p>
  <p>This is my code currently:</p>
  <pre><code>useEffect(() =&gt; {
          
          axios.get('https://api.covidactnow.org/v2/states.json?apiKey={apiKey}')
        
          .then(response =&gt; {
            return response.data;
            })
            .then(responseData =&gt; {
              console.log(responseData)
            })
          .catch(err =&gt; {
            console.log(err);
          });
        }, []);
  </code></pre>