Skip to content

Commit 66b217a

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

File tree

140 files changed

+1048
-851
lines changed

Some content is hidden

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

140 files changed

+1048
-851
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
}

package-lock.json

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

packages/module/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,16 @@
3838
"clsx": "^2.1.1"
3939
},
4040
"peerDependencies": {
41-
"react": "^17 || ^18",
42-
"react-dom": "^17 || ^18"
41+
"react": "^17 || ^18 || ^19",
42+
"react-dom": "^17 || ^18 || ^19"
4343
},
4444
"devDependencies": {
4545
"@patternfly/patternfly-a11y": "^5.1.0",
4646
"@patternfly/documentation-framework": "^6.5.16",
4747
"@patternfly/react-code-editor": "^6.0.0",
4848
"@patternfly/patternfly": "^6.0.0",
49-
"@types/react": "^18.2.33",
50-
"@types/react-dom": "^18.3.1",
49+
"@types/react": "^19.1.0",
50+
"@types/react-dom": "^19.1.2",
5151
"react": "^18.3.1",
5252
"react-dom": "^18.3.1",
5353
"typescript": "^5.8.3"

packages/module/patternfly-docs/content/extensions/component-groups/examples/Ansible/Ansible.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,13 @@ sourceLink: https://github.com/patternfly/react-component-groups/blob/main/packa
1515
---
1616

1717
import Ansible from '@patternfly/react-component-groups/dist/dynamic/Ansible';
18+
import { FunctionComponent } from 'react';
1819

1920
The **Ansible** component displays the Ansible project logo, with a support status style.
2021

2122
### Ansible supported
2223

23-
By default, the Ansible logo displays as normal and in full color, meaning that it is supported.
24+
By default, the Ansible logo displays as normal and in full color, meaning that it is supported.
2425

2526
```js file="./AnsibleSupportedExample.tsx"
2627

@@ -34,8 +35,7 @@ To specify that Ansible is not supported, set the `isSupported` property to `fal
3435

3536
```
3637

37-
38-
### Red Hat Ansible Automation Platform
38+
### Red Hat Ansible Automation Platform
3939

4040
To display the Red Hat Ansible Automation Platform, add the `isRHAAP` property to the `<Ansible>` component.
4141

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 { 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 & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
import React from 'react';
1+
import { FunctionComponent } from 'react';
22
import Ansible from '@patternfly/react-component-groups/dist/dynamic/Ansible';
33

4-
export const BasicExample: React.FunctionComponent = () => (
5-
<Ansible isRHAAP/>
6-
);
4+
export const BasicExample: FunctionComponent = () => <Ansible isRHAAP />;
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 { 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/BulkSelect.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ source: react
1313
propComponents: ['BulkSelect']
1414
sourceLink: https://github.com/patternfly/react-component-groups/blob/main/packages/module/patternfly-docs/content/extensions/component-groups/examples/BulkSelect/BulkSelect.md
1515
---
16-
import { useState } from 'react';
16+
1717
import { BulkSelect, BulkSelectValue } from '@patternfly/react-component-groups/dist/dynamic/BulkSelect';
18+
import { FunctionComponent, useState } from 'react';
1819

1920
The **bulk select** provides a way of selecting data records in batches. You can select all data at once, all data on current page or deselect all.
2021

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
import React, { useState } from 'react';
1+
import { FunctionComponent, useState } from 'react';
22
import { BulkSelect, BulkSelectValue } from '@patternfly/react-component-groups/dist/dynamic/BulkSelect';
33

4-
const allData = [ "Item 1", "Item 2" , "Item 3", "Item4", "Item 5" ];
5-
const pageData = [ "Item 1", "Item 2" ];
4+
const allData = ['Item 1', 'Item 2', 'Item 3', 'Item4', 'Item 5'];
5+
const pageData = ['Item 1', 'Item 2'];
66

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

1010
const handleBulkSelect = (value: BulkSelectValue) => {
1111
value === BulkSelectValue.none && setSelected([]);
1212
value === BulkSelectValue.all && setSelected(allData);
13-
value === BulkSelectValue.nonePage && setSelected(selected.filter(item => !pageData.includes(item)));
14-
value === BulkSelectValue.page && setSelected(Array.from(new Set([ ...selected, ...pageData ])));
13+
value === BulkSelectValue.nonePage && setSelected(selected.filter((item) => !pageData.includes(item)));
14+
value === BulkSelectValue.page && setSelected(Array.from(new Set([...selected, ...pageData])));
1515
};
1616

1717
return (
@@ -21,8 +21,10 @@ export const BasicExample: React.FunctionComponent = () => {
2121
pageCount={pageData.length}
2222
totalCount={allData.length}
2323
onSelect={handleBulkSelect}
24-
pageSelected={pageData.every(item => selected.includes(item))}
25-
pagePartiallySelected={pageData.some(item => selected.includes(item)) && !pageData.every(item => selected.includes(item))}
24+
pageSelected={pageData.every((item) => selected.includes(item))}
25+
pagePartiallySelected={
26+
pageData.some((item) => selected.includes(item)) && !pageData.every((item) => selected.includes(item))
27+
}
2628
/>
2729
);
28-
}
30+
};
Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,28 @@
1-
import React, { useState } from 'react';
1+
import { FunctionComponent, useState } from 'react';
22
import { BulkSelect, BulkSelectValue } from '@patternfly/react-component-groups/dist/dynamic/BulkSelect';
33

4-
const allData = [ "Item 1", "Item 2" , "Item 3", "Item4", "Item 5" ];
5-
const pageData = [ "Item 1", "Item 2" ];
4+
const allData = ['Item 1', 'Item 2', 'Item 3', 'Item4', 'Item 5'];
5+
const pageData = ['Item 1', 'Item 2'];
66

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

1010
const handleBulkSelect = (value: BulkSelectValue) => {
1111
value === BulkSelectValue.none && setSelected([]);
1212
value === BulkSelectValue.all && setSelected(allData);
13-
value === BulkSelectValue.nonePage && setSelected(selected.filter(item => !pageData.includes(item)));
14-
value === BulkSelectValue.page && setSelected(Array.from(new Set([ ...selected, ...pageData ])));
13+
value === BulkSelectValue.nonePage && setSelected(selected.filter((item) => !pageData.includes(item)));
14+
value === BulkSelectValue.page && setSelected(Array.from(new Set([...selected, ...pageData])));
1515
};
1616

1717
return (
1818
<BulkSelect
1919
selectedCount={selected.length}
2020
pageCount={pageData.length}
2121
onSelect={handleBulkSelect}
22-
pageSelected={pageData.every(item => selected.includes(item))}
23-
pagePartiallySelected={pageData.some(item => selected.includes(item)) && !pageData.every(item => selected.includes(item))}
22+
pageSelected={pageData.every((item) => selected.includes(item))}
23+
pagePartiallySelected={
24+
pageData.some((item) => selected.includes(item)) && !pageData.every((item) => selected.includes(item))
25+
}
2426
/>
2527
);
26-
}
28+
};

0 commit comments

Comments
 (0)