From 71c52373f81cace664047edd19d9d289f45a4dff Mon Sep 17 00:00:00 2001 From: Ricardo Cino Date: Thu, 7 Jul 2022 09:31:50 +0200 Subject: chore: Mobx & React-Router upgrade (#406) Co-authored-by: Vijay A --- src/components/util/ErrorBoundary/index.tsx | 3 +-- src/components/util/WithParams.tsx | 8 ++++++++ 2 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 src/components/util/WithParams.tsx (limited to 'src/components/util') 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 { } render(): ReactNode { - const { classes } = this.props; - const { intl } = this.props; + const { classes, intl } = this.props; if (this.state.hasError) { 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 @@ +import { useParams } from 'react-router-dom'; + +export default function withParams(Component: any) { + return (props: any) => { + const params = useParams(); + return ; + }; +} -- cgit v1.2.3-70-g09d2