const fetchData = async() => {
let url = 'http://localhost:81/'
let options = {
method: 'GET',
mode: 'cors',
};
const json = await caller(url, options);
return json;
};
useEffect(() => {
const json = fetchData();
console.log(json);
json.data.reverse();
...
}