diff options
Diffstat (limited to 'src/components/util/WithParams.tsx')
-rw-r--r-- | src/components/util/WithParams.tsx | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/components/util/WithParams.tsx b/src/components/util/WithParams.tsx new file mode 100644 index 000000000..6fc0957ff --- /dev/null +++ b/src/components/util/WithParams.tsx | |||
@@ -0,0 +1,8 @@ | |||
1 | import { useParams } from 'react-router-dom'; | ||
2 | |||
3 | export default function withParams(Component: any) { | ||
4 | return (props: any) => { | ||
5 | const params = useParams(); | ||
6 | return <Component {...props} params={params} />; | ||
7 | }; | ||
8 | } | ||