Skip to content

Commit ff1b188

Browse files
authored
Revert upgrade react and react-dom to version 19 (#899)
This reverts commit b0c8434.
1 parent b205598 commit ff1b188

File tree

8 files changed

+85
-77
lines changed

8 files changed

+85
-77
lines changed

package-lock.json

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

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@
6565
"ag-grid-community": "^33.0.3",
6666
"ag-grid-react": "^33.0.4",
6767
"notistack": "^3.0.2",
68-
"react": "^19.2.0",
69-
"react-dom": "^19.2.0",
68+
"react": "^18.3.1",
69+
"react-dom": "^18.3.1",
7070
"react-hook-form": "^7.54.2",
7171
"react-intl": "^7.1.6",
7272
"react-papaparse": "^4.4.0",
@@ -98,8 +98,8 @@
9898
"@types/localized-countries": "^2.0.3",
9999
"@types/node": "^22.18.1",
100100
"@types/prop-types": "^15.7.15",
101-
"@types/react": "^19.2.2",
102-
"@types/react-dom": "^19.2.1",
101+
"@types/react": "^18.3.24",
102+
"@types/react-dom": "^18.3.7",
103103
"@types/react-resizable": "^3.0.8",
104104
"@typescript-eslint/eslint-plugin": "^7.18.0",
105105
"@typescript-eslint/parser": "^7.18.0",
@@ -128,8 +128,8 @@
128128
"notistack": "^3.0.2",
129129
"prettier": "^3.6.2",
130130
"prettier-plugin-properties": "^0.3.0",
131-
"react": "^19.2.0",
132-
"react-dom": "^19.2.0",
131+
"react": "^18.3.1",
132+
"react-dom": "^18.3.1",
133133
"react-hook-form": "^7.62.0",
134134
"react-intl": "^7.1.11",
135135
"react-papaparse": "^4.4.0",

src/components/csvDownloader/csv-export.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
66
*/
77

8-
import { JSX, useCallback } from 'react';
8+
import { useCallback } from 'react';
99
import { CsvExportProps } from './csv-export.type';
1010
import { useCsvExport } from './use-csv-export';
1111
import { ExportCsvButton } from './export-csv-button';

src/components/dnd-table/dnd-table.type.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
66
*/
77

8-
import { JSX, ReactNode } from 'react';
8+
import { ReactNode } from 'react';
99
import { ElementType, EquipmentType } from '../../utils';
1010

1111
export const SELECTED = 'selected';

src/components/inputs/reactHookForm/errorManagement/ErrorInput.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
66
*/
77

8-
import React, { RefObject, useEffect, useRef } from 'react';
8+
import React, { MutableRefObject, useEffect, useRef } from 'react';
99
import { FormattedMessage } from 'react-intl';
1010
import { useController } from 'react-hook-form';
1111

@@ -29,7 +29,7 @@ export function ErrorInput({ name, InputField }: ErrorInputProps) {
2929
name,
3030
});
3131

32-
const errorRef: RefObject<any> = useRef(null);
32+
const errorRef: MutableRefObject<any> = useRef(null);
3333

3434
const errorProps = (errorMsg: ErrorMessage | undefined) => {
3535
if (typeof errorMsg === 'string') {

src/components/overflowableText/OverflowableText.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import { ReactNode, useCallback, useLayoutEffect, useMemo, useRef, useState } from 'react';
88
import { Box, type BoxProps, styled, Tooltip } from '@mui/material';
99
import { Style } from 'node:util';
10-
import type { SxStyle, MuiStyles } from '../../utils';
10+
import type { SxStyle, MuiStyles } from '../../utils/styles';
1111

1212
const overflowStyle = {
1313
overflow: {
@@ -49,7 +49,7 @@ export const OverflowableText = styled(
4949
children,
5050
...props
5151
}: OverflowableTextProps) => {
52-
const element = useRef<HTMLHeadingElement>(undefined);
52+
const element = useRef<HTMLHeadingElement>();
5353

5454
const isMultiLine = useMemo(() => maxLineCount && maxLineCount > 1, [maxLineCount]);
5555

src/hooks/usePrevious.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import { useEffect, useRef } from 'react';
88

99
export function usePrevious<T = undefined>(value: T) {
10-
const ref = useRef<T>(undefined);
10+
const ref = useRef<T>();
1111
useEffect(() => {
1212
ref.current = value;
1313
}, [value]);

src/hooks/useSnackMessage.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
66
*/
77

8-
import { RefObject, useCallback } from 'react';
8+
import { MutableRefObject, useCallback } from 'react';
99
import { BaseVariant, OptionsObject, closeSnackbar as closeSnackbarFromNotistack, useSnackbar } from 'notistack';
1010
import { IntlShape } from 'react-intl';
1111
import { useIntlRef } from './useIntlRef';
@@ -33,7 +33,7 @@ function checkInputs(txt?: string, id?: string, values?: SnackInputs['messageVal
3333
}
3434

3535
function checkAndTranslateIfNecessary(
36-
intlRef: RefObject<IntlShape>,
36+
intlRef: MutableRefObject<IntlShape>,
3737
txt?: string,
3838
id?: string,
3939
values?: SnackInputs['messageValues']
@@ -52,7 +52,7 @@ function checkAndTranslateIfNecessary(
5252
);
5353
}
5454

55-
function makeMessage(intlRef: RefObject<IntlShape>, snackInputs: SnackInputs): string | null {
55+
function makeMessage(intlRef: MutableRefObject<IntlShape>, snackInputs: SnackInputs): string | null {
5656
const message = checkAndTranslateIfNecessary(
5757
intlRef,
5858
snackInputs.messageTxt,

0 commit comments

Comments
 (0)