aboutsummaryrefslogtreecommitdiffstats
path: root/webui/src/pages/bug/BugQuery.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'webui/src/pages/bug/BugQuery.tsx')
-rw-r--r--webui/src/pages/bug/BugQuery.tsx11
1 files changed, 5 insertions, 6 deletions
diff --git a/webui/src/pages/bug/BugQuery.tsx b/webui/src/pages/bug/BugQuery.tsx
index fd0fb9d4..6b31197d 100644
--- a/webui/src/pages/bug/BugQuery.tsx
+++ b/webui/src/pages/bug/BugQuery.tsx
@@ -1,5 +1,5 @@
import * as React from 'react';
-import { RouteComponentProps } from 'react-router-dom';
+import { useParams } from 'react-router-dom';
import CircularProgress from '@material-ui/core/CircularProgress';
@@ -8,13 +8,12 @@ import NotFoundPage from '../notfound/NotFoundPage';
import Bug from './Bug';
import { useGetBugQuery } from './BugQuery.generated';
-type Props = RouteComponentProps<{
- id: string;
-}>;
+const BugQuery: React.FC = () => {
+ const params = useParams<'id'>();
+ if (params.id === undefined) throw new Error('missing route parameters');
-const BugQuery: React.FC<Props> = ({ match }: Props) => {
const { loading, error, data } = useGetBugQuery({
- variables: { id: match.params.id },
+ variables: { id: params.id },
});
if (loading) return <CircularProgress />;
if (!data?.repository?.bug) return <NotFoundPage />;