import userApi from "../../apis/user.api"; import { useEffect, useState } from "react"; const userprofile = localStorage.getItem("user"); const INIT_PROFILE = { name: "", email: "a", id: "", phone: "", }; const Info = () => { const [profile, setProfile] = useState(INIT_PROFILE); async function getProfile(userID) { try { const data = await userApi.getUser({id:userID}); setProfile(data); console.log(data) } catch (error) {} } useEffect(() => { getProfile(userprofile); }, [userprofile]); return (
{profile.email} #{profile.id}

이름

{profile.name}

전화번호

{profile.phone}

); }; export default Info;