diff options
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 | } | ||