import { Link, useParams } from "react-router-dom"; import { useState, useEffect } from "react"; import userApi from "../../apis/user.api"; const userprofile = localStorage.getItem("user"); const INIT_PROFILE = { img: "", }; const Profile = () => { const [profile, setProfile] = useState(INIT_PROFILE); async function getProfile(userID) { try { const data = await userApi.getUser(userID); setProfile(data.img); } catch (error) {} } useEffect(() => { getProfile(userprofile); }, []); const { id } = useParams(); return (
<>
profileImg
); }; export default Profile;