Skip to content

Commit 10ea26c

Browse files
Merge pull request #328 from CMSgov/QPPA-10520
QPPA-10520: upgrade react and react dom
2 parents 53bcc39 + dbeac33 commit 10ea26c

File tree

8 files changed

+3932
-4228
lines changed

8 files changed

+3932
-4228
lines changed

jest.setup.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { TextEncoder, TextDecoder } from 'util';
2+
3+
// polyfill before any tests or imports run
4+
;(global as any).TextEncoder = TextEncoder;
5+
;(global as any).TextDecoder = TextDecoder;

package-lock.json

Lines changed: 3892 additions & 4202 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,35 +26,37 @@
2626
"url": "https://github.com/CMSgov/qpp-submissions-docs/issues"
2727
},
2828
"homepage": "https://cmsgov.github.io/qpp-submissions-docs",
29+
"overrides": {
30+
"react-day-picker": "^9.6.7"
31+
},
2932
"dependencies": {
30-
"@cmsgov/design-system": "11.0.0",
33+
"@cmsgov/design-system": "12.4.1",
3134
"@vitejs/plugin-react": "4.3.1",
32-
"@xzar90/react-router-hash-link": "6.0.4",
3335
"core-js": "3.36.0",
3436
"font-awesome": "4.7.0",
3537
"postcss": "8.4.35",
3638
"postcss-scss": "4.0.9",
37-
"react": "17.0.2",
39+
"react": "19.1.0",
3840
"react-code-blocks": "0.1.6",
39-
"react-dom": "17.0.2",
40-
"react-router-dom": "6.22.3",
41+
"react-dom": "19.1.0",
42+
"react-router-dom": "7.6.3",
4143
"react-router-hash-link": "2.4.3",
4244
"sass": "1.64.0",
4345
"typescript": "5.3.3",
44-
"vite": "5.4.8",
46+
"vite": "5.4.19",
4547
"vite-tsconfig-paths": "4.3.1"
4648
},
4749
"devDependencies": {
50+
"@emotion/is-prop-valid": "1.3.1",
4851
"@eslint/eslintrc": "3.1.0",
4952
"@eslint/js": "9.11.1",
50-
"@testing-library/jest-dom": "6.4.2",
51-
"@testing-library/react": "12.1.5",
52-
"@testing-library/user-event": "14.5.2",
53+
"@testing-library/jest-dom": "6.6.3",
54+
"@testing-library/react": "16.3.0",
55+
"@testing-library/user-event": "14.6.1",
5356
"@types/jest": "29.5.13",
5457
"@types/node": "^20.11.25",
55-
"@types/react": "^17.0.11",
56-
"@types/react-dom": "^18.0.4",
57-
"@types/react-router-dom": "5.3.3",
58+
"@types/react": "19.1.8",
59+
"@types/react-dom": "19.1.6",
5860
"@types/react-router-hash-link": "2.4.9",
5961
"@typescript-eslint/eslint-plugin": "8.7.0",
6062
"@typescript-eslint/parser": "8.7.0",
@@ -83,6 +85,7 @@
8385
"jest": {
8486
"preset": "ts-jest/presets/js-with-ts",
8587
"testEnvironment": "jest-environment-jsdom",
88+
"setupFiles": ["<rootDir>/jest.setup.ts"],
8689
"moduleNameMapper": {
8790
"\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/__mocks__/fileMock.js",
8891
"\\.(css|scss|less)$": "<rootDir>/__mocks__/styleMock.js"

src/app/components/app.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { MemoryRouter } from 'react-router-dom';
1+
import { MemoryRouter } from 'react-router';
22
import {render, fireEvent } from '@testing-library/react';
33
import '@testing-library/jest-dom';
44

src/app/components/app.tsx

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

44
import { combinedRoutes } from '../routes';
55

@@ -63,4 +63,4 @@ const App = () => {
6363
);
6464
};
6565

66-
export default App;
66+
export default App;

src/app/components/left-nav.tsx

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

33
import Routes, { IPath } from '../routes';
44

src/index.tsx

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,23 @@
11
import './polyfills';
2-
3-
import ReactDOM from 'react-dom';
4-
import { BrowserRouter as Router } from 'react-router-dom';
2+
import { createRoot } from 'react-dom/client';
3+
import { BrowserRouter as Router } from 'react-router';
4+
import { StyleSheetManager } from 'styled-components';
5+
import isPropValid from '@emotion/is-prop-valid';
56

67
import App from './app/components/app';
7-
88
import './index.scss';
99
import envConfig from './envConfig';
1010

11+
const rootElement = document.getElementById('root');
12+
if (!rootElement) {
13+
throw new Error('Root element not found');
14+
}
1115

12-
ReactDOM.render(
13-
<Router basename={envConfig.baseUrl}>
14-
<App />,
15-
</Router>,
16-
document.getElementById('root')
16+
const root = createRoot(rootElement);
17+
root.render(
18+
<StyleSheetManager shouldForwardProp={prop => isPropValid(prop)}>
19+
<Router basename={envConfig.baseUrl}>
20+
<App />
21+
</Router>
22+
</StyleSheetManager>
1723
);

src/shared/link-to-id.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { HashLink } from '@xzar90/react-router-hash-link';
1+
import { HashLink } from 'react-router-hash-link';
22

33
export const LinkToId = ({ to, text, offset = '1' }: { to: string, text: string, offset?: string }) => {
44
return (

0 commit comments

Comments
 (0)