diff options
author | crupest <crupest@outlook.com> | 2021-12-06 20:46:35 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2021-12-06 20:46:35 +0800 |
commit | 2d9ef25d6171890496b1c9dd48a91b11c40eca7c (patch) | |
tree | ac48193d08296dd880005e8e0399b0b48a4bcc5d /FrontEnd/src/views/user/index.tsx | |
parent | de0c85ca334d06f042e685b8263a3261b8f8b055 (diff) | |
download | timeline-2d9ef25d6171890496b1c9dd48a91b11c40eca7c.tar.gz timeline-2d9ef25d6171890496b1c9dd48a91b11c40eca7c.tar.bz2 timeline-2d9ef25d6171890496b1c9dd48a91b11c40eca7c.zip |
...
Diffstat (limited to 'FrontEnd/src/views/user/index.tsx')
-rw-r--r-- | FrontEnd/src/views/user/index.tsx | 10 |
1 files changed, 8 insertions, 2 deletions
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<number>(0); |