Last active
February 10, 2021 18:37
-
-
Save moonformeli/55c62e6b88c3a1df6c739adde2d1bfb9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function MyPage() { | |
const [myInfo, setMyInfo] = useState(null); | |
const [billHistory, setBillHistory] = useState([]); | |
const [friendsList, setFriendsList] = useState([]); | |
useEffect(() => { | |
(async () => { | |
const mInfo = await fetchMyInfo(); | |
const bHistory = await fetchBillHistory(); | |
const fList = await fetchFriendsList(); | |
setMyInfo(mInfo); | |
setBillHistory(bHistory); | |
setFriendsList(fList); | |
})(); | |
}, []); | |
return ( | |
<div> | |
{myInfo && <MyInfo myInfo={myInfo} />} | |
{billHistory.length > 0 && <BillHistory billHistory={billHistory} />} | |
{friendsList.length > 0 && <FriendsList friendsList={friendsList} />} | |
</div> | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment