summaryrefslogtreecommitdiffhomepage
path: root/gui
diff options
context:
space:
mode:
authorHank <hank@mullvad.net>2022-10-20 16:41:49 +0200
committerHank <hank@mullvad.net>2022-10-20 16:41:49 +0200
commita4d3987482f73b831ad83ce01e1f4dea72881ced (patch)
tree70ed91f20870b9068e258c4d23e6c7bf054e9e2d /gui
parentca1bbade3ea6e0528f984c08e6118da7ef849eca (diff)
downloadmullvadvpn-a4d3987482f73b831ad83ce01e1f4dea72881ced.tar.xz
mullvadvpn-a4d3987482f73b831ad83ce01e1f4dea72881ced.zip
Remove withHistory
Diffstat (limited to 'gui')
-rw-r--r--gui/src/renderer/lib/history.tsx15
1 files changed, 1 insertions, 14 deletions
diff --git a/gui/src/renderer/lib/history.tsx b/gui/src/renderer/lib/history.tsx
index 9a0205b382..486093cca0 100644
--- a/gui/src/renderer/lib/history.tsx
+++ b/gui/src/renderer/lib/history.tsx
@@ -1,6 +1,5 @@
import { Action, History as OriginalHistory, Location, LocationDescriptorObject } from 'history';
-import React from 'react';
-import { RouteComponentProps, useHistory as useReactRouterHistory, withRouter } from 'react-router';
+import { useHistory as useReactRouterHistory } from 'react-router';
import { IHistoryObject } from '../../shared/ipc-types';
import { GeneratedRoutePath, RoutePath } from './routes';
@@ -220,15 +219,3 @@ export default class History {
export function useHistory(): History {
return useReactRouterHistory() as History;
}
-
-export interface IHistoryProps {
- history: History;
-}
-
-export function withHistory<P>(BaseComponent: React.ComponentType<P & IHistoryProps>) {
- return withRouter((props: P & RouteComponentProps) => {
- const history = props.history as History;
- const mergedProps = ({ ...props, history } as unknown) as P & IHistoryProps;
- return <BaseComponent {...mergedProps} />;
- });
-}