Skip to content

Commit 4348c4b

Browse files
committed
upgrades to react router v7
1 parent 077faa6 commit 4348c4b

51 files changed

Lines changed: 97 additions & 168 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/App/frontend/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@
6464
"@types/node": "24.10.7",
6565
"@types/react": "19.2.8",
6666
"@types/react-dom": "19.2.3",
67-
"@types/react-router-dom": "5.3.3",
6867
"@types/uuid": "11.0.0",
6968
"@typescript-eslint/eslint-plugin": "8.52.0",
7069
"@typescript-eslint/parser": "8.52.0",
@@ -176,7 +175,7 @@
176175
"react-dropzone": "14.3.8",
177176
"react-leaflet": "5.0.0",
178177
"react-number-format": "5.4.4",
179-
"react-router-dom": "6.30.3",
178+
"react-router": "7.13.0",
180179
"react-toastify": "11.0.5",
181180
"terraformer-wkt-parser": "1.2.1",
182181
"typescript": "5.9.3",

src/App/frontend/src/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import { Navigate, Outlet, Route, Routes } from 'react-router-dom';
2+
import { Navigate, Outlet, Route, Routes } from 'react-router';
33

44
import { Form } from 'src/components/form/Form';
55
import { PresentationComponent } from 'src/components/presentation/Presentation';

src/App/frontend/src/components/form/Form.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { useEffect, useMemo } from 'react';
2-
import { useLocation, useNavigate, useSearchParams } from 'react-router-dom';
2+
import { useLocation, useNavigate, useSearchParams } from 'react-router';
33

44
import { Flex } from 'src/app-components/Flex/Flex';
55
import classes from 'src/components/form/Form.module.css';

src/App/frontend/src/components/form/LinkToPotentialNode.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
2-
import { Link } from 'react-router-dom';
3-
import type { LinkProps } from 'react-router-dom';
2+
import { Link } from 'react-router';
3+
import type { LinkProps } from 'react-router';
44

55
import { SearchParams } from 'src/core/routing/types';
66
import { useIsHidden } from 'src/utils/layout/hidden';

src/App/frontend/src/components/form/LinkToPotentialPage.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
2-
import { Link } from 'react-router-dom';
3-
import type { LinkProps } from 'react-router-dom';
2+
import { Link } from 'react-router';
3+
import type { LinkProps } from 'react-router';
44

55
import { useNavigatePage } from 'src/hooks/useNavigatePage';
66
import { useIsHiddenPage } from 'src/utils/layout/hidden';

src/App/frontend/src/components/wrappers/ProcessWrapper.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { useEffect, useState } from 'react';
2-
import { useLocation, useNavigate } from 'react-router-dom';
2+
import { useLocation, useNavigate } from 'react-router';
33
import type { PropsWithChildren } from 'react';
44

55
import { useQueryClient } from '@tanstack/react-query';

src/App/frontend/src/core/routing/useIsNavigating.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useLocation, useNavigation } from 'react-router-dom';
1+
import { useLocation, useNavigation } from 'react-router';
22

33
// TODO: make this redundant
44
export function useIsNavigating() {

src/App/frontend/src/core/ui/RenderStart.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { useEffect } from 'react';
2-
import { useLocation } from 'react-router-dom';
2+
import { useLocation } from 'react-router';
33
import type { PropsWithChildren } from 'react';
44

55
import { loadingAttribute, useHasElementsByAttribute } from 'src/components/ReadyForPrint';

src/App/frontend/src/features/entrypoint/Entrypoint.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import { Navigate, Outlet } from 'react-router-dom';
2+
import { Navigate, Outlet } from 'react-router';
33

44
import { Loader } from 'src/core/loading/Loader';
55
import { getApplicationMetadata, useIsStateless } from 'src/features/applicationMetadata';

src/App/frontend/src/features/formData/FormData.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { useState } from 'react';
2-
import { MemoryRouter, Route, Routes, useNavigate } from 'react-router-dom';
2+
import { MemoryRouter, Route, Routes, useNavigate } from 'react-router';
33
import type { PropsWithChildren } from 'react';
44

55
import { afterAll, beforeAll, expect, jest } from '@jest/globals';
@@ -114,7 +114,7 @@ async function statelessRender(props: RenderProps) {
114114
...props,
115115
initialRenderRef,
116116
router: ({ children }: PropsWithChildren) => (
117-
<MemoryRouter future={{ v7_relativeSplatPath: true, v7_startTransition: true }}>
117+
<MemoryRouter>
118118
<Routes>
119119
<Route
120120
path='/'

0 commit comments

Comments
 (0)