{info["Username"]}
About me :
woops...
import { useState, useEffect } from 'react'; import { useRouter } from 'next/router'; import Dashboard from '../../components/ui'; export default function Profile() { const router = useRouter(); let [info, setInfo] = useState({}); useEffect(() => { if (!router.isReady) return; let token = localStorage.getItem("Token"); let ps = async () => { const { pid } = router.query setInfo(await fetch(`http://127.0.0.1:3000/profile/${pid}`, { headers: { "Authorization": `Bearer ${token}` }, mode: "cors" }).then(r => r.json())); } ps().catch(console.error); }, [router.isReady]); return (
About me :
woops...