score:0

Accepted answer
export async function getPersonInfo(person?: Person): Promise<Person>{
  //some code here
  return response.data.person
}

score:1

useEffect(() => {
  if (person) {
    getPersonInfo(person).then((data) => {
      setPerson(data);
    });
  }
}, [person]);

Related Query

More Query from same tag