diff options
author | 2022-07-07 09:31:50 +0200 | |
---|---|---|
committer | 2022-07-07 09:31:50 +0200 | |
commit | 71c52373f81cace664047edd19d9d289f45a4dff (patch) | |
tree | 69b3f1d45a8b3f1ceab9497ea3c96e9dc18e3166 /src/components/util/WithParams.tsx | |
parent | 6.0.0-nightly.91 [skip ci] (diff) | |
download | ferdium-app-71c52373f81cace664047edd19d9d289f45a4dff.tar.gz ferdium-app-71c52373f81cace664047edd19d9d289f45a4dff.tar.zst ferdium-app-71c52373f81cace664047edd19d9d289f45a4dff.zip |
chore: Mobx & React-Router upgrade (#406)
Co-authored-by: Vijay A <vraravam@users.noreply.github.com>
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 | } | ||