From 2d9ef25d6171890496b1c9dd48a91b11c40eca7c Mon Sep 17 00:00:00 2001 From: crupest Date: Mon, 6 Dec 2021 20:46:35 +0800 Subject: ... --- FrontEnd/src/views/user/index.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'FrontEnd/src/views/user') diff --git a/FrontEnd/src/views/user/index.tsx b/FrontEnd/src/views/user/index.tsx index 70b4f60f..7913b788 100644 --- a/FrontEnd/src/views/user/index.tsx +++ b/FrontEnd/src/views/user/index.tsx @@ -1,13 +1,19 @@ import React from "react"; -import { useParams } from "react-router"; +import { useParams } from "react-router-dom"; import TimelinePageTemplate from "../timeline-common/TimelinePageTemplate"; import UserCard from "./UserCard"; +import { UiLogicError } from "@/common"; + import "./index.css"; const UserPage: React.FC = () => { - const { username } = useParams<{ username: string }>(); + const { username } = useParams(); + + if (username == null) { + throw new UiLogicError("No route param 'username'."); + } const [reloadKey, setReloadKey] = React.useState(0); -- cgit v1.2.3