Skip to content

Commit

Permalink
Merge pull request #4290 from greenbone/address-react-router-warnings
Browse files Browse the repository at this point in the history
Address warnings of React Router
  • Loading branch information
bjoernricks authored Jan 16, 2025
2 parents a41c576 + 2bfa11a commit 3985053
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 14 deletions.
19 changes: 11 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"react-dom": "^18.3.1",
"react-i18next": "^15.4.0",
"react-redux": "^9.1.2",
"react-router-dom": "^6.28.0",
"react-router-dom": "^6.28.1",
"redux": "^5.0.1",
"redux-logger": "^3.0.6",
"resize-observer-polyfill": "^1.5.1",
Expand Down
22 changes: 18 additions & 4 deletions src/web/routes.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,14 @@ const LoggedInRoutes = () => {

<Route element={<PageNotFound />} path="/notfound" />
<Route element={<AuditReportsPage />} path="/auditreports" />
<Route element={<DeltaAuditReportDetailsPage />}
path="/auditreport/delta/:id/:deltaid" />
<Route element= {<AuditReportDetailsPage />} path="/auditreport/:id" />
<Route
element={<DeltaAuditReportDetailsPage />}
path="/auditreport/delta/:id/:deltaid"
/>
<Route
element={<AuditReportDetailsPage />}
path="/auditreport/:id"
/>
<Route element={<Navigate to="/dashboards" />} path="/" />

<Route element={<PageNotFound />} path="*" />
Expand All @@ -241,7 +246,16 @@ const AppRoutes = () => {
}

return (
<Router>{isLoggedIn ? <LoggedInRoutes /> : <LoggedOutRoutes />}</Router>
<Router
future={{
// eslint-disable-next-line camelcase
v7_startTransition: true,
// eslint-disable-next-line camelcase
v7_relativeSplatPath: false,
}}
>
{isLoggedIn ? <LoggedInRoutes /> : <LoggedOutRoutes />}
</Router>
);
};

Expand Down
12 changes: 11 additions & 1 deletion src/web/utils/testing.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,17 @@ export const rendererWith = (
<TestingLicenseProvider license={license}>
<TestingStoreProvider store={store}>
{router ? (
<BrowserRouter initialEntries={['/']}>{children}</BrowserRouter>
<BrowserRouter
future={{
// eslint-disable-next-line camelcase
v7_startTransition: true,
// eslint-disable-next-line camelcase
v7_relativeSplatPath: false,
}}
initialEntries={['/']}
>
{children}
</BrowserRouter>
) : (
children
)}
Expand Down

0 comments on commit 3985053

Please sign in to comment.