Skip to content

Commit 2a84a93

Browse files
committed
chore(React19): Allow support for React 19
1 parent bd32ade commit 2a84a93

File tree

39 files changed

+2084
-5635
lines changed

39 files changed

+2084
-5635
lines changed

.eslintrc.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@
9494
"react-hooks/exhaustive-deps": "warn",
9595
"react/no-unescaped-entities": ["error", { "forbid": [">", "}"] }],
9696
"spaced-comment": "error",
97-
"use-isnan": "error"
97+
"use-isnan": "error",
98+
"react/react-in-jsx-scope": "off"
9899
}
99100
}

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,6 @@ lerna-debug.log
3232
# For vim
3333
*.swp
3434

35-
public
35+
public
36+
37+
packages/module/patternfly-docs/generated

package.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@
2323
"update": "node scripts/importUpdatesFromOldRepo.js"
2424
},
2525
"devDependencies": {
26-
"react": "^18",
27-
"react-dom": "^18",
2826
"concurrently": "^5.3.0",
2927
"eslint": "^8.0.1",
3028
"eslint-plugin-markdown": "^1.0.2",
@@ -35,8 +33,8 @@
3533
"eslint-plugin-promise": "^6.0.0",
3634
"eslint-config-prettier": "8.5.0",
3735
"typescript": "^4.7.4",
38-
"@types/react": "^17.0.0",
39-
"@types/react-dom": "^17.0.0",
36+
"@types/react": "^19",
37+
"@types/react-dom": "^19",
4038
"@typescript-eslint/eslint-plugin": "^5.42.0",
4139
"@typescript-eslint/parser": "^5.42.0",
4240
"prettier": "2.7.1",

packages/module/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@
4444
"@patternfly/react-styles": "^6.1.0"
4545
},
4646
"peerDependencies": {
47-
"react": "^17 || ^18",
48-
"react-dom": "^17 || ^18"
47+
"react": "^17 || ^18 || ^19",
48+
"react-dom": "^17 || ^18 || ^19"
4949
},
5050
"devDependencies": {
5151
"@patternfly/patternfly": "^6.1.0",

packages/module/patternfly-docs/content/examples/CatalogTile.md

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,10 @@ import './catalogTile.css';
1818
Note: Catalog tile lives in its own package at [`@patternfly/react-catalog-view-extension`](https://www.npmjs.com/package/@patternfly/react-catalog-view-extension)!
1919

2020
## Examples
21+
2122
### Basic featured tile
23+
2224
```js
23-
import React from 'react';
2425
import { CatalogTile, CatalogTileBadge } from '@patternfly/react-catalog-view-extension';
2526
import CogIcon from '@patternfly/react-icons/dist/esm/icons/cog-icon';
2627
import pfLogo6 from './pfLogo6.svg';
@@ -43,12 +44,12 @@ import '../../../../dist/css/react-catalog-view-extension.css';
4344
'Three lines is the default for cards without a footer. Cards with a footer are truncated after one line. Truncation function use is deprecated; please pass in a maxDescriptionLength of -1 to override it. ' +
4445
'This has changed from PatternFly 3.'
4546
}
46-
/>
47+
/>;
4748
```
4849

4950
### Basic with footer
51+
5052
```js
51-
import React from 'react';
5253
import { CatalogTile, CatalogTileBadge } from '@patternfly/react-catalog-view-extension';
5354
import CogIcon from '@patternfly/react-icons/dist/esm/icons/cog-icon';
5455
import OutlinedCheckCircleIcon from '@patternfly/react-icons/dist/esm/icons/outlined-check-circle-icon';
@@ -72,15 +73,15 @@ import pfLogo6 from './pfLogo6.svg';
7273
}
7374
footer={
7475
<span>
75-
<OutlinedCheckCircleIcon style={{color: 'var(--pf-v6-global--success-color--100)'}} /> Enabled
76+
<OutlinedCheckCircleIcon style={{ color: 'var(--pf-v6-global--success-color--100)' }} /> Enabled
7677
</span>
7778
}
78-
/>
79+
/>;
7980
```
8081

8182
### Link variant
83+
8284
```js
83-
import React from 'react';
8485
import { CatalogTile, CatalogTileBadge } from '@patternfly/react-catalog-view-extension';
8586
import CogIcon from '@patternfly/react-icons/dist/esm/icons/cog-icon';
8687
import pfLogo6 from './pfLogo6.svg';
@@ -102,12 +103,12 @@ import pfLogo6 from './pfLogo6.svg';
102103
'Three lines is the default for cards without a footer. Cards with a footer are truncated after one line. Truncation function use is deprecated; please pass in a maxDescriptionLength of -1 to override it. ' +
103104
'This has changed from PatternFly 3.'
104105
}
105-
/>
106+
/>;
106107
```
107108

108109
### With multiple icon badges
110+
109111
```js
110-
import React from 'react';
111112
import { CatalogTile, CatalogTileBadge } from '@patternfly/react-catalog-view-extension';
112113
import CogIcon from '@patternfly/react-icons/dist/esm/icons/cog-icon';
113114
import OutlinedCheckCircleIcon from '@patternfly/react-icons/dist/esm/icons/outlined-check-circle-icon';
@@ -122,7 +123,7 @@ import pfLogo6 from './pfLogo6.svg';
122123
<CogIcon />
123124
</CatalogTileBadge>,
124125
<CatalogTileBadge title="USDA Approved">
125-
<OutlinedCheckCircleIcon style={{color: 'var(--pf-v6-global--success-color--100)'}} />
126+
<OutlinedCheckCircleIcon style={{ color: 'var(--pf-v6-global--success-color--100)' }} />
126127
</CatalogTileBadge>
127128
]}
128129
title="Patternfly-React"
@@ -132,35 +133,33 @@ import pfLogo6 from './pfLogo6.svg';
132133
'Three lines is the default for cards without a footer. Cards with a footer are truncated after one line. Truncation function use is deprecated; please pass in a maxDescriptionLength of -1 to override it. ' +
133134
'This has changed from PatternFly 3.'
134135
}
135-
/>
136+
/>;
136137
```
137138

138139
### With text badge
140+
139141
```js
140-
import React from 'react';
141142
import { CatalogTile } from '@patternfly/react-catalog-view-extension';
142143
import pfLogo6 from './pfLogo6.svg';
143144

144145
<CatalogTile
145146
id="text-badge"
146147
iconImg={pfLogo6}
147148
iconAlt="PatternFly logo"
148-
badges={[
149-
'Community'
150-
]}
149+
badges={['Community']}
151150
title="Patternfly-React"
152151
vendor="provided by Red Hat"
153152
description={
154153
'This is a very, very long description that should be truncated after three lines. ' +
155154
'Three lines is the default for cards without a footer. Cards with a footer are truncated after one line. Truncation function use is deprecated; please pass in a maxDescriptionLength of -1 to override it. ' +
156155
'This has changed from PatternFly 3.'
157156
}
158-
/>
157+
/>;
159158
```
160159

161160
### With children instead of description
161+
162162
```js
163-
import React from 'react';
164163
import { CatalogTile, CatalogTileBadge } from '@patternfly/react-catalog-view-extension';
165164
import CogIcon from '@patternfly/react-icons/dist/esm/icons/cog-icon';
166165
import pfLogo6 from './pfLogo6.svg';
@@ -178,10 +177,9 @@ import pfLogo6 from './pfLogo6.svg';
178177
title="Patternfly-React"
179178
vendor="provided by Red Hat"
180179
>
181-
This is a very, very long stetch of child text that should be not be truncated
182-
and illustrates how Flyers can add longer content to PatternFly 4 catalog tiles
183-
using the children prop. Cards usually truncate descriptions at three lines.
184-
Cards with a footer are truncated after one line. This has changed from PatternFly 3.
185-
Children can be of any length.
186-
</CatalogTile>
180+
This is a very, very long stetch of child text that should be not be truncated and illustrates how Flyers can add
181+
longer content to PatternFly 4 catalog tiles using the children prop. Cards usually truncate descriptions at three
182+
lines. Cards with a footer are truncated after one line. This has changed from PatternFly 3. Children can be of any
183+
length.
184+
</CatalogTile>;
187185
```

0 commit comments

Comments
 (0)