aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/components/hoc/withRouter.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'server/sonar-web/src/main/js/components/hoc/withRouter.tsx')
-rw-r--r--server/sonar-web/src/main/js/components/hoc/withRouter.tsx11
1 files changed, 4 insertions, 7 deletions
diff --git a/server/sonar-web/src/main/js/components/hoc/withRouter.tsx b/server/sonar-web/src/main/js/components/hoc/withRouter.tsx
index b352d94c268..0a286faffa9 100644
--- a/server/sonar-web/src/main/js/components/hoc/withRouter.tsx
+++ b/server/sonar-web/src/main/js/components/hoc/withRouter.tsx
@@ -45,10 +45,8 @@ export interface WithRouterProps {
}
export function withRouter<P extends Partial<WithRouterProps>>(
- WrappedComponent: React.ComponentType<React.PropsWithChildren<React.PropsWithChildren<P>>>,
-): React.ComponentType<
- React.PropsWithChildren<React.PropsWithChildren<Omit<P, keyof WithRouterProps>>>
-> {
+ WrappedComponent: React.ComponentType<React.PropsWithChildren<P>>,
+): React.ComponentType<React.PropsWithChildren<Omit<P, keyof WithRouterProps>>> {
function ComponentWithRouterProp(props: P) {
const router = useRouter();
const params = useParams();
@@ -57,9 +55,8 @@ export function withRouter<P extends Partial<WithRouterProps>>(
return <WrappedComponent {...props} location={location} params={params} router={router} />;
}
- (
- ComponentWithRouterProp as React.FC<React.PropsWithChildren<React.PropsWithChildren<P>>>
- ).displayName = getWrappedDisplayName(WrappedComponent, 'withRouter');
+ (ComponentWithRouterProp as React.FC<React.PropsWithChildren<P>>).displayName =
+ getWrappedDisplayName(WrappedComponent, 'withRouter');
return ComponentWithRouterProp;
}