hope you guys have a great great day! :)
I want to ask something, i need to return some list data from API,
I have 3 files, one called getUser.js and the othe is User.js and OtherUser.js, i already fetch the data from API in getUser.js, and i need to access the data from getUser.js to populate User.js and OtherUser.js
The Problem is, i can't return the data in getUser.js
here's my code in getUser.js
import React from "react";
export const getUser = async () => {
await fetch("https://myapi.com")
.then((response) => response.json())
.then((res) => {
return res;
});
};
and when i console.log inside User.js and OtherUser.js, i got this
Promise {
"_U": 0,
"_V": 0,
"_W": null,
"_X": null,
}
and here's my code in User.js and OtherUser.js looks like:
import React, {useState} from 'react'
import { getUser } from './someplace/getUser'
export default function User() {
useEffect(()=>{getDataFromUser()},[])
const getDataFromUser = async() => {
console.log(getUser())
}
}
Did you guys know why? please help :)

await getUser()