import { useAsync } from 'rc-hooks'; import { useParams } from 'react-router-dom'; import PageContainer from '@/components/PageContainer'; import { getReposByName } from '@/services/repos'; const DetailPage = () => { const { name } = useParams(); const { data, loading } = useAsync(() => getReposByName(name!).then((res) => res.data)); return (
{loading && (
详情页数据请求中...
)} {!loading && data && (

{data.full_name}

{data.description}

链接: {data.html_url}

)}
); }; export default DetailPage;