Skip to content

Commit f03a6da

Browse files
committed
refactor: remove History from withRouteProps typing
Signed-off-by: Aryan Ghotekar <aryanghotekar95@gmail.com>
1 parent 3859308 commit f03a6da

1 file changed

Lines changed: 2 additions & 12 deletions

File tree

packages/jaeger-ui/src/utils/withRouteProps.tsx

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33

44
import React from 'react';
55
import { useLocation, useParams } from 'react-router-dom';
6-
import { History, Location } from 'history';
7-
import { history } from './configure-store';
6+
import { Location } from 'history';
87

98
/**
109
* Interface representing route-related props passed to the enhanced component.
@@ -13,14 +12,12 @@ import { history } from './configure-store';
1312
* @property {string} pathname - The current URL pathname.
1413
* @property {string} search - The current URL search string.
1514
* @property {object} params - The URL parameters.
16-
* @property {History} history - The history object for navigation.
1715
*/
1816
export type IWithRouteProps = {
1917
location: Location;
2018
pathname: string;
2119
search: string;
2220
params: object;
23-
history: History;
2421
};
2522

2623
/**
@@ -65,14 +62,7 @@ export default function withRouteProps(WrappedComponent: React.ElementType) {
6562
* @returns {React.Component} The enhanced component with additional route-related props.
6663
*/
6764
return (
68-
<WrappedComponent
69-
{...props}
70-
location={location}
71-
pathname={pathname}
72-
search={search}
73-
params={params}
74-
history={history}
75-
/>
65+
<WrappedComponent {...props} location={location} pathname={pathname} search={search} params={params} />
7666
);
7767
};
7868
}

0 commit comments

Comments
 (0)