score:1

Accepted answer
useEffect(() => {
    fetch("http://localhost:8080/restApiTest")
      .then(res => res.json())
      .then(data => {
         let array_people = data.map((p) => {
             return p.firstName + ' ' + p.lastName;
         });
         setPeople(array_people);
         setFiltered(array_people)
      });
 }, []);

Related Query

More Query from same tag