Skip to content

Commit f1badee

Browse files
committed
chore(React19): Enable React19
1 parent 79a8b98 commit f1badee

File tree

117 files changed

+337
-332
lines changed

Some content is hidden

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

117 files changed

+337
-332
lines changed

.eslintrc.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"plugin:react/recommended",
1010
"plugin:react-hooks/recommended",
1111
"plugin:@typescript-eslint/recommended",
12+
"plugin:react/jsx-runtime",
1213
"prettier"
1314
],
1415
"overrides": [
@@ -95,6 +96,7 @@
9596
"react-hooks/exhaustive-deps": "warn",
9697
"react/no-unescaped-entities": ["error", { "forbid": [">", "}"] }],
9798
"spaced-comment": "error",
98-
"use-isnan": "error"
99+
"use-isnan": "error",
100+
"react/react-in-jsx-scope": "off"
99101
}
100102
}

packages/module/package.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,19 +35,20 @@
3535
"@patternfly/react-icons": "^6.0.0",
3636
"@patternfly/react-table": "^6.0.0",
3737
"react-jss": "^10.10.0",
38-
"clsx": "^2.1.1"
38+
"clsx": "^2.1.1",
39+
"react": "19"
3940
},
4041
"peerDependencies": {
41-
"react": "^17 || ^18",
42-
"react-dom": "^17 || ^18"
42+
"react": "^17 || ^18 || ^19",
43+
"react-dom": "^17 || ^18 || ^19"
4344
},
4445
"devDependencies": {
4546
"@patternfly/patternfly-a11y": "^5.1.0",
4647
"@patternfly/documentation-framework": "^6.5.16",
4748
"@patternfly/react-code-editor": "^6.0.0",
4849
"@patternfly/patternfly": "^6.0.0",
49-
"@types/react": "^18.2.33",
50-
"@types/react-dom": "^18.3.1",
50+
"@types/react": "^19.1.0",
51+
"@types/react-dom": "^19.1.2",
5152
"react": "^18.3.1",
5253
"react-dom": "^18.3.1",
5354
"typescript": "^5.8.3"
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React from 'react';
1+
import type { FunctionComponent } from 'react';
22
import Ansible from '@patternfly/react-component-groups/dist/dynamic/Ansible';
33

4-
export const BasicExample: React.FunctionComponent = () => <Ansible />;
4+
export const BasicExample: FunctionComponent = () => <Ansible />;
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import React from 'react';
1+
import type { FunctionComponent } from 'react';
22
import Ansible from '@patternfly/react-component-groups/dist/dynamic/Ansible';
33

4-
export const BasicExample: React.FunctionComponent = () => (
4+
export const BasicExample: FunctionComponent = () => (
55
<Ansible isRHAAP/>
66
);
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React from 'react';
1+
import type { FunctionComponent } from 'react';
22
import Ansible from '@patternfly/react-component-groups/dist/dynamic/Ansible';
33

4-
export const BasicExample: React.FunctionComponent = () => <Ansible isSupported={false} />;
4+
export const BasicExample: FunctionComponent = () => <Ansible isSupported={false} />;

packages/module/patternfly-docs/content/extensions/component-groups/examples/BulkSelect/BulkSelectAllExample.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
import React, { useState } from 'react';
1+
import type { FunctionComponent } from 'react';
2+
import { useState } from 'react';
23
import { BulkSelect, BulkSelectValue } from '@patternfly/react-component-groups/dist/dynamic/BulkSelect';
34

45
const allData = [ "Item 1", "Item 2" , "Item 3", "Item4", "Item 5" ];
56
const pageData = [ "Item 1", "Item 2" ];
67

7-
export const BasicExample: React.FunctionComponent = () => {
8+
export const BasicExample: FunctionComponent = () => {
89
const [ selected, setSelected ] = useState<string[]>(pageData);
910

1011
const handleBulkSelect = (value: BulkSelectValue) => {

packages/module/patternfly-docs/content/extensions/component-groups/examples/BulkSelect/BulkSelectExample.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
import React, { useState } from 'react';
1+
import type { FunctionComponent } from 'react';
2+
import { useState } from 'react';
23
import { BulkSelect, BulkSelectValue } from '@patternfly/react-component-groups/dist/dynamic/BulkSelect';
34

45
const allData = [ "Item 1", "Item 2" , "Item 3", "Item4", "Item 5" ];
56
const pageData = [ "Item 1", "Item 2" ];
67

7-
export const BasicExample: React.FunctionComponent = () => {
8+
export const BasicExample: FunctionComponent = () => {
89
const [ selected, setSelected ] = useState<string[]>([]);
910

1011
const handleBulkSelect = (value: BulkSelectValue) => {

packages/module/patternfly-docs/content/extensions/component-groups/examples/CloseButton/CloseButtonExample.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/* eslint-disable no-console */
2-
import React from 'react'
2+
import type { FunctionComponent } from 'react';
33
import CloseButton from '@patternfly/react-component-groups/dist/dynamic/CloseButton';
44

5-
export const BasicExample: React.FunctionComponent = () => (
5+
export const BasicExample: FunctionComponent = () => (
66
<>
77
<CloseButton dataTestID="close-button-example" onClick={()=>{console.log('Close button clicked')}} style={{ float: 'none' }} />
88
</>

packages/module/patternfly-docs/content/extensions/component-groups/examples/ColumnManagementModal/ColumnManagementModalExample.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import React from 'react'
1+
import type { FunctionComponent } from 'react';
2+
import { useState } from 'react';
23
import { Button, ButtonVariant } from '@patternfly/react-core';
34
import { Table, Tbody, Td, Th, Tr, Thead } from '@patternfly/react-table';
45
import { ColumnsIcon } from '@patternfly/react-icons';
@@ -59,9 +60,9 @@ const ROWS = [
5960
}
6061
]
6162

62-
export const ColumnManagementModalExample: React.FunctionComponent = () => {
63-
const [ columns, setColumns ] = React.useState(DEFAULT_COLUMNS);
64-
const [ isOpen, setOpen ] = React.useState(false);
63+
export const ColumnManagementModalExample: FunctionComponent = () => {
64+
const [ columns, setColumns ] = useState(DEFAULT_COLUMNS);
65+
const [ isOpen, setOpen ] = useState(false);
6566

6667
return (
6768
<>

packages/module/patternfly-docs/content/extensions/component-groups/examples/ErrorBoundary/ErrorBoundaryExample.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
import React, { useState } from 'react';
1+
import type { FunctionComponent } from 'react';
2+
import { useState } from 'react';
23
import { Title, Button, Card, CardBody, CardFooter, CardHeader } from '@patternfly/react-core';
34
import ErrorBoundary from '@patternfly/react-component-groups/dist/dynamic/ErrorBoundary';
45

5-
export const BasicExample: React.FunctionComponent = () => {
6+
export const BasicExample: FunctionComponent = () => {
67
const [ hasError, setHasError ] = useState(false);
78

89
const Surprise = () => {

0 commit comments

Comments
 (0)