Skip to content

Commit

Permalink
Use the react-router-dom-v5-compat library
Browse files Browse the repository at this point in the history
  • Loading branch information
jgyselov committed Aug 1, 2024
1 parent 44b3067 commit 36314a4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-i18next": "^11.11.4",
"react-router-dom": "^5.3.3"
"react-router-dom": "^5.3.3",
"react-router-dom-v5-compat": "^6.21.2"
},
"devDependencies": {
"@redhat-cloud-services/eslint-config-redhat-cloud-services": "^2.0.3",
Expand Down
7 changes: 5 additions & 2 deletions src/components/RootApp.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import React, { useEffect, useState } from 'react';
import { Api, Config, Routes } from '@openshift-assisted/ui-lib/ocm';
import { Api, Config, UILibRoutes } from '@openshift-assisted/ui-lib/ocm';
import type { FeatureListType } from '@openshift-assisted/ui-lib/common';
import { BrowserRouter } from 'react-router-dom';
import { CompatRouter } from 'react-router-dom-v5-compat';
import { AxiosInstance, AxiosRequestConfig } from 'axios';
import '../i18n';
import useChrome from '@redhat-cloud-services/frontend-components/useChrome';
Expand Down Expand Up @@ -53,7 +54,9 @@ function RootApp({
return (
<React.StrictMode>
<BrowserRouter basename={'/openshift'}>
<Routes allEnabledFeatures={allEnabledFeatures} />
<CompatRouter>
<UILibRoutes allEnabledFeatures={allEnabledFeatures} />
</CompatRouter>
</BrowserRouter>
</React.StrictMode>
);
Expand Down

0 comments on commit 36314a4

Please sign in to comment.