Skip to content

Commit 954e9be

Browse files
authored
chore(react): add support for react 19 (#5826)
1 parent 50cde53 commit 954e9be

File tree

256 files changed

+767
-807
lines changed

Some content is hidden

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

256 files changed

+767
-807
lines changed

.changeset/old-suits-brush.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
"@aws-amplify/ui-react": patch
3+
"@aws-amplify/ui-react-ai": patch
4+
"@aws-amplify/ui-react-core": patch
5+
"@aws-amplify/ui-react-core-notifications": patch
6+
"@aws-amplify/ui-react-geo": patch
7+
"@aws-amplify/ui-react-liveness": patch
8+
"@aws-amplify/ui-react-native": patch
9+
"@aws-amplify/ui-react-notifications": patch
10+
"@aws-amplify/ui-react-storage": patch
11+
---
12+
13+
chore(react): add support for React 19

build-system-tests/templates/components/react-native/cli/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ function SignOutButton() {
2323
return <Button title="Sign Out" onPress={signOut} />;
2424
}
2525

26-
function App(): JSX.Element {
26+
function App(): React.JSX.Element {
2727
return (
2828
<>
2929
<Authenticator.Provider>

docs/.eslintrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"extends": "next/core-web-vitals",
2+
"extends": ["next", "next/core-web-vitals"],
33
"rules": {
44
"react-hooks/exhaustive-deps": "error" // override next eslint default
55
}

docs/__tests__/__snapshots__/props-table.test.ts.snap

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2970,7 +2970,7 @@ exports[`Props Table 1`] = `
29702970
},
29712971
"children": {
29722972
"name": "children",
2973-
"type": "(item: Item, index: number) => JSX.Element",
2973+
"type": "(item: Item, index: number) => React.JSX.Element",
29742974
"description": "The component to be repeated\\nSame interface as Array.prototype.map",
29752975
"category": "CollectionChildren",
29762976
"isOptional": false
@@ -7712,10 +7712,10 @@ exports[`Props Table 1`] = `
77127712
"category": "BaseInputProps",
77137713
"isOptional": true
77147714
},
7715-
"placeholder": {
7716-
"name": "placeholder",
7717-
"type": "string | undefined",
7718-
"description": "Placeholder text shown when field is empty Accessibility tip: avoid putting important instructions for filling out the TextField in the placeholder. Use descriptiveText for important instructions.",
7715+
"enterKeyHint": {
7716+
"name": "enterKeyHint",
7717+
"type": "EnterKeyHint | undefined",
7718+
"description": "Defines what action label (or icon) to present for the enter key on virtual keyboards. See: [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/enterkeyhint)",
77197719
"category": "BaseInputProps",
77207720
"isOptional": true
77217721
},
@@ -7747,6 +7747,13 @@ exports[`Props Table 1`] = `
77477747
"category": "BaseInputProps",
77487748
"isOptional": true
77497749
},
7750+
"name": {
7751+
"name": "name",
7752+
"type": "string | undefined",
7753+
"description": "Name of the field. Submitted with the form as part of a name/value pair.",
7754+
"category": "BaseInputProps",
7755+
"isOptional": true
7756+
},
77507757
"autoComplete": {
77517758
"name": "autoComplete",
77527759
"type": "string | undefined",
@@ -7768,13 +7775,6 @@ exports[`Props Table 1`] = `
77687775
"category": "BaseInputProps",
77697776
"isOptional": true
77707777
},
7771-
"enterKeyHint": {
7772-
"name": "enterKeyHint",
7773-
"type": "EnterKeyHint | undefined",
7774-
"description": "Defines what action label (or icon) to present for the enter key on virtual keyboards. See: [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/enterkeyhint)",
7775-
"category": "BaseInputProps",
7776-
"isOptional": true
7777-
},
77787778
"isReadOnly": {
77797779
"name": "isReadOnly",
77807780
"type": "boolean | undefined",
@@ -7789,10 +7789,10 @@ exports[`Props Table 1`] = `
77897789
"category": "BaseInputProps",
77907790
"isOptional": true
77917791
},
7792-
"name": {
7793-
"name": "name",
7792+
"placeholder": {
7793+
"name": "placeholder",
77947794
"type": "string | undefined",
7795-
"description": "Name of the field. Submitted with the form as part of a name/value pair.",
7795+
"description": "Placeholder text shown when field is empty Accessibility tip: avoid putting important instructions for filling out the TextField in the placeholder. Use descriptiveText for important instructions.",
77967796
"category": "BaseInputProps",
77977797
"isOptional": true
77987798
},
@@ -8394,10 +8394,10 @@ exports[`Props Table 1`] = `
83948394
"category": "BaseInputProps",
83958395
"isOptional": true
83968396
},
8397-
"placeholder": {
8398-
"name": "placeholder",
8399-
"type": "string | undefined",
8400-
"description": "Placeholder text shown when field is empty Accessibility tip: avoid putting important instructions for filling out the TextField in the placeholder. Use descriptiveText for important instructions.",
8397+
"enterKeyHint": {
8398+
"name": "enterKeyHint",
8399+
"type": "EnterKeyHint | undefined",
8400+
"description": "Defines what action label (or icon) to present for the enter key on virtual keyboards. See: [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/enterkeyhint)",
84018401
"category": "BaseInputProps",
84028402
"isOptional": true
84038403
},
@@ -8436,13 +8436,6 @@ exports[`Props Table 1`] = `
84368436
"category": "BaseInputProps",
84378437
"isOptional": true
84388438
},
8439-
"enterKeyHint": {
8440-
"name": "enterKeyHint",
8441-
"type": "EnterKeyHint | undefined",
8442-
"description": "Defines what action label (or icon) to present for the enter key on virtual keyboards. See: [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/enterkeyhint)",
8443-
"category": "BaseInputProps",
8444-
"isOptional": true
8445-
},
84468439
"isReadOnly": {
84478440
"name": "isReadOnly",
84488441
"type": "boolean | undefined",
@@ -8456,6 +8449,13 @@ exports[`Props Table 1`] = `
84568449
"description": "Whether field should be marked required.",
84578450
"category": "BaseInputProps",
84588451
"isOptional": true
8452+
},
8453+
"placeholder": {
8454+
"name": "placeholder",
8455+
"type": "string | undefined",
8456+
"description": "Placeholder text shown when field is empty Accessibility tip: avoid putting important instructions for filling out the TextField in the placeholder. Use descriptiveText for important instructions.",
8457+
"category": "BaseInputProps",
8458+
"isOptional": true
84598459
}
84608460
}
84618461
},
@@ -8936,7 +8936,7 @@ exports[`Props Table 1`] = `
89368936
},
89378937
"emptyIcon": {
89388938
"name": "emptyIcon",
8939-
"type": "JSX.Element | undefined",
8939+
"type": "React.JSX.Element | undefined",
89408940
"description": "This will override which icon to use as the empty icon. This will only\\noverride the empty icon an will create a rating component that uses\\ndifferent icons for filled and empty icons.",
89418941
"category": "RatingOptions",
89428942
"isOptional": true
@@ -8950,7 +8950,7 @@ exports[`Props Table 1`] = `
89508950
},
89518951
"icon": {
89528952
"name": "icon",
8953-
"type": "JSX.Element | undefined",
8953+
"type": "React.JSX.Element | undefined",
89548954
"description": "This will override which icon to use. This will override both\\nthe filled and empty icon values unless an empty icon is specified\\nwith the emptyIcon prop\\nDefault is <IconStar />",
89558955
"category": "RatingOptions",
89568956
"isOptional": true

docs/package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
"postbuild:sitemap": "node --require esbuild-register ./scripts/generate-sitemap-robotstxt.ts",
2121
"start": "next start",
2222
"test": "jest",
23-
"test:links": "node --require esbuild-register ./scripts/link-checker-puppeteer.ts"
23+
"test:links": "node --require esbuild-register ./scripts/link-checker-puppeteer.ts",
24+
"typecheck": "tsc --noEmit"
2425
},
2526
"dependencies": {
2627
"@aws-amplify/ui-react": "6.7.2",
@@ -38,9 +39,9 @@
3839
"next-plugin-preval": "^1.2.1",
3940
"prism-react-renderer": "1.2.1",
4041
"raw-loader": "^4.0.2",
41-
"react": "18.2.0",
42+
"react": "^18.3.0",
4243
"react-copy-to-clipboard": "^5.0.4",
43-
"react-dom": "18.2.0",
44+
"react-dom": "^18.3.0",
4445
"react-icons": "^4.3.1",
4546
"react-live": "^4.1.8",
4647
"rehype": "^11.0.0",

docs/src/components/CodeHighlight.tsx

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,17 +43,9 @@ export const CodeHighlight = ({
4343
>
4444
<View as="code" className={classNames(className, prismClassName)}>
4545
{tokens.map((line, i) => (
46-
<View
47-
className="code-line"
48-
key={i}
49-
{...getLineProps({ line, key: i })}
50-
>
46+
<View {...getLineProps({ line })} className="code-line" key={i}>
5147
{line.map((token, key) => (
52-
<Text
53-
as="span"
54-
key={key}
55-
{...getTokenProps({ token, key })}
56-
/>
48+
<Text {...getTokenProps({ token })} as="span" key={key} />
5749
))}
5850
</View>
5951
))}

docs/src/components/ExpoSnack.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export const ExpoSnack = (options: SnackOptions) => {
6565
// We need a unique ID b/c we need to listen to window events that the iframe
6666
// will send and it sends the iframe id
6767
const id = React.useRef(Math.random().toString(36).substring(2, 10));
68-
const ref = React.useRef<HTMLIFrameElement>();
68+
const ref = React.useRef<HTMLIFrameElement>(undefined);
6969
const [theme, setTheme] = React.useState('light');
7070

7171
React.useLayoutEffect(() => {

docs/src/components/Layout/GlobalNav/components/DesktopNav.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ interface DesktopNavProps {
1212
navLinksContainerRef: MutableRefObject<HTMLDivElement>;
1313
navLinksRightRef: MutableRefObject<HTMLDivElement>;
1414
hasSecondaryNav: boolean;
15-
secondaryNavDesktop?: JSX.Element;
15+
secondaryNavDesktop?: React.JSX.Element;
1616
}
1717

1818
export function DesktopNav({

docs/src/components/Layout/GlobalNav/components/NavMenuLink.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export function NavMenuLink({
1515
setShowGlobalNav?: Dispatch<SetStateAction<boolean>>;
1616
}) {
1717
const label: string = navMenuItem.label;
18-
const linkContent: JSX.Element =
18+
const linkContent: React.JSX.Element =
1919
navMenuItem.type === 'EXTERNAL' ? (
2020
<ExternalLink>{label}</ExternalLink>
2121
) : (

docs/src/components/propsTable/PropsTableBody.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { Property } from '../../../scripts/types/catalog';
77
export const PropsTableBody = ([
88
propName,
99
{ name, type, description, isOptional },
10-
]: [string, Property]): JSX.Element => {
10+
]: [string, Property]): React.JSX.Element => {
1111
return (
1212
<TableRow key={name}>
1313
<ResponsiveTableCell label="Name">

0 commit comments

Comments
 (0)