From 18a938642b795449562ede4c3be3e2784bce473b Mon Sep 17 00:00:00 2001 From: Arnei Date: Wed, 26 Feb 2025 15:44:24 +0100 Subject: [PATCH] Update React to major version 19 As well as associated dependencies. Also fixes errors this causes. --- package-lock.json | 65 +++++++++---------- package.json | 6 +- .../partials/modals/SeriesDetailsModal.tsx | 2 +- .../partials/modal/RecordingDetailsModal.tsx | 2 +- src/components/shared/ConfirmModal.tsx | 2 +- src/components/shared/EditTableViewModal.tsx | 2 +- src/components/shared/HotKeyCheatSheet.tsx | 2 +- src/components/shared/NewResourceModal.tsx | 2 +- src/components/shared/RegistrationModal.tsx | 2 +- src/components/shared/Table.tsx | 2 +- .../partials/modal/GroupDetailsModal.tsx | 2 +- src/hooks/wizardHooks.ts | 2 +- 12 files changed, 45 insertions(+), 46 deletions(-) diff --git a/package-lock.json b/package-lock.json index a312f657f9..d337fe2933 100644 --- a/package-lock.json +++ b/package-lock.json @@ -28,10 +28,10 @@ "lodash": "^4.17.21", "moment": "^2.30.1", "moment-timezone": "^0.5.47", - "react": "^18.3.1", + "react": "^19.0.0", "react-chartjs-2": "^5.3.0", "react-datepicker": "^8.0.0", - "react-dom": "^18.3.1", + "react-dom": "^19.0.0", "react-hotkeys-hook": "^4.6.1", "react-i18next": "^15.4.0", "react-icons": "^5.4.0", @@ -51,7 +51,7 @@ "@redux-devtools/extension": "^3.3.0", "@types/lodash": "^4.17.15", "@types/node": "^22.13.0", - "@types/react-dom": "^18.3.0", + "@types/react-dom": "^19.0.0", "@types/uuid": "^10.0.0", "@typescript-eslint/eslint-plugin": "^7.14.1", "@vitejs/plugin-react-swc": "^3.7.2", @@ -2944,9 +2944,9 @@ } }, "node_modules/@floating-ui/react": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@floating-ui/react/-/react-0.27.3.tgz", - "integrity": "sha512-CLHnes3ixIFFKVQDdICjel8muhFLOBdQH7fgtHNPY8UbCNqbeKZ262G7K66lGQOUQWWnYocf7ZbUsLJgGfsLHg==", + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@floating-ui/react/-/react-0.27.4.tgz", + "integrity": "sha512-05mXdkUiVh8NCEcYKQ2C9SV9IkZ9k/dFtYmaEIN2riLv80UHoXylgBM76cgPJYfLJM3dJz7UE5MOVH0FypMd2Q==", "license": "MIT", "dependencies": { "@floating-ui/react-dom": "^2.1.2", @@ -4635,21 +4635,22 @@ "integrity": "sha512-gNMvNH49DJ7OJYv+KAKn0Xp45p8PLl6zo2YnvDIbTd4J6MER2BmWN49TG7n9LvkyihINxeKW8+3bfS2yDC9dzQ==" }, "node_modules/@types/react": { - "version": "18.3.5", - "resolved": "https://registry.npmjs.org/@types/react/-/react-18.3.5.tgz", - "integrity": "sha512-WeqMfGJLGuLCqHGYRGHxnKrXcTitc6L/nBUWfWPcTarG3t9PsquqUMuVeXZeca+mglY4Vo5GZjCi0A3Or2lnxA==", + "version": "19.0.10", + "resolved": "https://registry.npmjs.org/@types/react/-/react-19.0.10.tgz", + "integrity": "sha512-JuRQ9KXLEjaUNjTWpzuR231Z2WpIwczOkBEIvbHNCzQefFIT0L8IqE6NV6ULLyC1SI/i234JnDoMkfg+RjQj2g==", + "license": "MIT", "dependencies": { - "@types/prop-types": "*", "csstype": "^3.0.2" } }, "node_modules/@types/react-dom": { - "version": "18.3.0", - "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.3.0.tgz", - "integrity": "sha512-EhwApuTmMBmXuFOikhQLIBUn6uFg81SwLMOAUgodJF14SOBOCMdU04gDoYi0WOJJHD144TL32z4yDqCW3dnkQg==", + "version": "19.0.4", + "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-19.0.4.tgz", + "integrity": "sha512-4fSQ8vWFkg+TGhePfUzVmat3eC14TXYSsiiDSLI0dVLsrm9gZFABjPy/Qu6TKgl1tq1Bu1yDsuQgY3A3DOjCcg==", "dev": true, - "dependencies": { - "@types/react": "*" + "license": "MIT", + "peerDependencies": { + "@types/react": "^19.0.0" } }, "node_modules/@types/react-transition-group": { @@ -6519,6 +6520,7 @@ "version": "5.2.1", "resolved": "https://registry.npmjs.org/dom-helpers/-/dom-helpers-5.2.1.tgz", "integrity": "sha512-nRCa7CK3VTrM2NmGkIy4cbK7IZlgBE/PYMn55rrXefr5xXDP0LdtfPnblFDoVdcAfslJ7or6iqAUnx0CCGIWQA==", + "license": "MIT", "dependencies": { "@babel/runtime": "^7.8.7", "csstype": "^3.0.2" @@ -9749,12 +9751,10 @@ "integrity": "sha512-tQkJl2GRWh83ui2DiPTJz9wEiMN20syf+5oKfB03yYP7ioZcJwsIK8FjrtLwH1m7C7e+Tt2yYBlrOpdT+dyeIQ==" }, "node_modules/react": { - "version": "18.3.1", - "resolved": "https://registry.npmjs.org/react/-/react-18.3.1.tgz", - "integrity": "sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==", - "dependencies": { - "loose-envify": "^1.1.0" - }, + "version": "19.0.0", + "resolved": "https://registry.npmjs.org/react/-/react-19.0.0.tgz", + "integrity": "sha512-V8AVnmPIICiWpGfm6GLzCR/W5FXLchHop40W4nXBmdlEceh16rCN8O8LNWm5bh5XUX91fh7KpA+W0TgMKmgTpQ==", + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -9785,15 +9785,15 @@ } }, "node_modules/react-dom": { - "version": "18.3.1", - "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.3.1.tgz", - "integrity": "sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==", + "version": "19.0.0", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.0.0.tgz", + "integrity": "sha512-4GV5sHFG0e/0AD4X+ySy6UJd3jVl1iNsNHdpad0qhABJ11twS3TTBnseqsKurKcsNqCEFeGL3uLpVChpIO3QfQ==", + "license": "MIT", "dependencies": { - "loose-envify": "^1.1.0", - "scheduler": "^0.23.2" + "scheduler": "^0.25.0" }, "peerDependencies": { - "react": "^18.3.1" + "react": "^19.0.0" } }, "node_modules/react-fast-compare": { @@ -9916,6 +9916,7 @@ "version": "4.4.5", "resolved": "https://registry.npmjs.org/react-transition-group/-/react-transition-group-4.4.5.tgz", "integrity": "sha512-pZcd1MCJoiKiBR2NRxeCRg13uCXbydPnmB4EOeRrY7480qNWO8IIgQG6zlDkm6uRMsURXPuKq0GWtiM59a5Q6g==", + "license": "BSD-3-Clause", "dependencies": { "@babel/runtime": "^7.5.5", "dom-helpers": "^5.0.1", @@ -10267,12 +10268,10 @@ "dev": true }, "node_modules/scheduler": { - "version": "0.23.2", - "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.2.tgz", - "integrity": "sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==", - "dependencies": { - "loose-envify": "^1.1.0" - } + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.25.0.tgz", + "integrity": "sha512-xFVuu11jh+xcO7JOAGJNOXld8/TcEHK/4CituBUeUb5hqxJLj9YuemAEuvm9gQ/+pgXYfbQuqAkiYu+u7YEsNA==", + "license": "MIT" }, "node_modules/semver": { "version": "6.3.1", diff --git a/package.json b/package.json index db713484cc..85dc9da05f 100644 --- a/package.json +++ b/package.json @@ -25,10 +25,10 @@ "lodash": "^4.17.21", "moment": "^2.30.1", "moment-timezone": "^0.5.47", - "react": "^18.3.1", + "react": "^19.0.0", "react-chartjs-2": "^5.3.0", "react-datepicker": "^8.0.0", - "react-dom": "^18.3.1", + "react-dom": "^19.0.0", "react-hotkeys-hook": "^4.6.1", "react-i18next": "^15.4.0", "react-icons": "^5.4.0", @@ -66,7 +66,7 @@ "@redux-devtools/extension": "^3.3.0", "@types/lodash": "^4.17.15", "@types/node": "^22.13.0", - "@types/react-dom": "^18.3.0", + "@types/react-dom": "^19.0.0", "@types/uuid": "^10.0.0", "@typescript-eslint/eslint-plugin": "^7.14.1", "@vitejs/plugin-react-swc": "^3.7.2", diff --git a/src/components/events/partials/modals/SeriesDetailsModal.tsx b/src/components/events/partials/modals/SeriesDetailsModal.tsx index d455178b04..f6d483480a 100644 --- a/src/components/events/partials/modals/SeriesDetailsModal.tsx +++ b/src/components/events/partials/modals/SeriesDetailsModal.tsx @@ -15,7 +15,7 @@ const SeriesDetailsModal = ({ }: { seriesTitle: string seriesId: string - modalRef: React.RefObject + modalRef: React.RefObject }) => { const { t } = useTranslation(); const dispatch = useAppDispatch(); diff --git a/src/components/recordings/partials/modal/RecordingDetailsModal.tsx b/src/components/recordings/partials/modal/RecordingDetailsModal.tsx index 1305b0318a..1f835e6383 100644 --- a/src/components/recordings/partials/modal/RecordingDetailsModal.tsx +++ b/src/components/recordings/partials/modal/RecordingDetailsModal.tsx @@ -11,7 +11,7 @@ const RecordingDetailsModal = ({ modalRef, }: { recordingId: string, - modalRef: React.RefObject + modalRef: React.RefObject }) => { const { t } = useTranslation(); diff --git a/src/components/shared/ConfirmModal.tsx b/src/components/shared/ConfirmModal.tsx index 0f52c88066..716e286d7f 100644 --- a/src/components/shared/ConfirmModal.tsx +++ b/src/components/shared/ConfirmModal.tsx @@ -25,7 +25,7 @@ const ConfirmModal = ({ showCautionMessage?: boolean, deleteNotAllowedMessage?: string, deleteWithCautionMessage?: string, - modalRef: React.RefObject + modalRef: React.RefObject }) => { const { t } = useTranslation(); diff --git a/src/components/shared/EditTableViewModal.tsx b/src/components/shared/EditTableViewModal.tsx index 6da9e10e0f..7901174548 100644 --- a/src/components/shared/EditTableViewModal.tsx +++ b/src/components/shared/EditTableViewModal.tsx @@ -20,7 +20,7 @@ const EditTableViewModal = ({ modalRef, }: { close: () => void, - modalRef: React.RefObject + modalRef: React.RefObject }) => { const { t } = useTranslation(); diff --git a/src/components/shared/HotKeyCheatSheet.tsx b/src/components/shared/HotKeyCheatSheet.tsx index 898cb626d9..db93483248 100644 --- a/src/components/shared/HotKeyCheatSheet.tsx +++ b/src/components/shared/HotKeyCheatSheet.tsx @@ -11,7 +11,7 @@ import { Modal, ModalHandle } from "./modals/Modal"; const HotKeyCheatSheet = ({ modalRef, }: { - modalRef: React.RefObject + modalRef: React.RefObject }) => { const { t } = useTranslation(); const { hotkeys } = useHotkeysContext(); diff --git a/src/components/shared/NewResourceModal.tsx b/src/components/shared/NewResourceModal.tsx index 54ec1c758d..1129e9aaa0 100644 --- a/src/components/shared/NewResourceModal.tsx +++ b/src/components/shared/NewResourceModal.tsx @@ -20,7 +20,7 @@ const NewResourceModal = ({ }: { handleClose: () => void, resource: "events" | "series" | "user" | "group" | "acl" | "themes" - modalRef: React.RefObject + modalRef: React.RefObject }) => { const { t } = useTranslation(); diff --git a/src/components/shared/RegistrationModal.tsx b/src/components/shared/RegistrationModal.tsx index 4415ad12df..43893a4f7f 100644 --- a/src/components/shared/RegistrationModal.tsx +++ b/src/components/shared/RegistrationModal.tsx @@ -21,7 +21,7 @@ import { Modal, ModalHandle } from "./modals/Modal"; const RegistrationModal = ({ modalRef }: { - modalRef: React.RefObject + modalRef: React.RefObject }) => { const { t } = useTranslation(); diff --git a/src/components/shared/Table.tsx b/src/components/shared/Table.tsx index 70c3b20a51..1716884728 100644 --- a/src/components/shared/Table.tsx +++ b/src/components/shared/Table.tsx @@ -1,4 +1,4 @@ -import React, { useEffect, useRef, useState } from "react"; +import React, { JSX, useEffect, useRef, useState } from "react"; import { useTranslation } from "react-i18next"; import { getPageOffset, diff --git a/src/components/users/partials/modal/GroupDetailsModal.tsx b/src/components/users/partials/modal/GroupDetailsModal.tsx index 8f55f27e07..3b7f943dd2 100644 --- a/src/components/users/partials/modal/GroupDetailsModal.tsx +++ b/src/components/users/partials/modal/GroupDetailsModal.tsx @@ -13,7 +13,7 @@ const GroupDetailsModal = ({ }: { close: () => void, groupName: string, - modalRef: React.RefObject + modalRef: React.RefObject }) => { const { t } = useTranslation(); diff --git a/src/hooks/wizardHooks.ts b/src/hooks/wizardHooks.ts index 0be07373b6..92bc3d20ac 100644 --- a/src/hooks/wizardHooks.ts +++ b/src/hooks/wizardHooks.ts @@ -99,7 +99,7 @@ export const useSelectionChanges = ( }; export const useClickOutsideField = ( - childRef: React.RefObject, + childRef: React.RefObject, isFirstField?: boolean, ) => { // Indicator if currently edit mode is activated