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 | |
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')
-rw-r--r-- | src/components/util/ErrorBoundary/index.tsx | 3 | ||||
-rw-r--r-- | src/components/util/WithParams.tsx | 8 |
2 files changed, 9 insertions, 2 deletions
diff --git a/src/components/util/ErrorBoundary/index.tsx b/src/components/util/ErrorBoundary/index.tsx index 846d6dc3f..b042e62c8 100644 --- a/src/components/util/ErrorBoundary/index.tsx +++ b/src/components/util/ErrorBoundary/index.tsx | |||
@@ -32,8 +32,7 @@ class ErrorBoundary extends Component<ErrorBoundaryProps> { | |||
32 | } | 32 | } |
33 | 33 | ||
34 | render(): ReactNode { | 34 | render(): ReactNode { |
35 | const { classes } = this.props; | 35 | const { classes, intl } = this.props; |
36 | const { intl } = this.props; | ||
37 | 36 | ||
38 | if (this.state.hasError) { | 37 | if (this.state.hasError) { |
39 | return ( | 38 | return ( |
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 | } | ||