From 954e9be2d055a57ebddab5b902e3e6b427d09f67 Mon Sep 17 00:00:00 2001 From: Caleb Pollman Date: Thu, 19 Dec 2024 14:32:29 -0800 Subject: [PATCH] chore(react): add support for react 19 (#5826) --- .changeset/old-suits-brush.md | 13 + .../components/react-native/cli/App.tsx | 2 +- docs/.eslintrc.json | 2 +- .../__snapshots__/props-table.test.ts.snap | 56 +- docs/package.json | 7 +- docs/src/components/CodeHighlight.tsx | 12 +- docs/src/components/ExpoSnack.tsx | 2 +- .../GlobalNav/components/DesktopNav.tsx | 2 +- .../GlobalNav/components/NavMenuLink.tsx | 2 +- .../components/propsTable/PropsTableBody.tsx | 2 +- .../propsTable/PropsTableExpander.tsx | 4 +- .../components/alert/AlertPropControls.tsx | 2 +- .../autocomplete/AutocompletePropControls.tsx | 2 +- .../components/avatar/AvatarPropControls.tsx | 2 +- .../components/badge/BadgePropControls.tsx | 2 +- .../CheckboxFieldPropControls.tsx | 2 +- .../collection/CollectionPropControls.tsx | 2 +- .../divider/DividerPropControls.tsx | 2 +- .../fieldset/FieldsetPropControls.tsx | 2 +- .../components/flex/FlexPropControls.tsx | 2 +- .../grid/GridContainerPropControls.tsx | 2 +- .../components/grid/GridItemPropControls.tsx | 2 +- .../heading/HeadingPropControls.tsx | 2 +- .../HighlightMatchPropControls.tsx | 2 +- .../components/icon/IconPropControls.tsx | 2 +- .../components/image/ImagePropControls.tsx | 2 +- .../components/input/InputPropControls.tsx | 2 +- .../components/link/LinkPropControls.tsx | 2 +- .../components/menu/MenuPropControls.tsx | 2 +- .../message/MessagePropControls.tsx | 2 +- .../pagination/PaginationPropControls.tsx | 2 +- .../passwordFieldPropControls.tsx | 2 +- .../PhoneNumberFieldPropControls.tsx | 2 +- .../RadioGroupFieldPropControls.tsx | 2 +- .../components/rating/RatingPropControls.tsx | 2 +- .../searchfield/SearchFieldPropControls.tsx | 2 +- .../selectfield/SelectFieldPropControls.tsx | 2 +- .../components/shared/StylePropControls.tsx | 2 +- .../sliderfield/SliderFieldPropControls.tsx | 2 +- .../switchfield/SwitchPropControls.tsx | 2 +- .../components/table/TablePropControls.tsx | 2 +- .../components/tabs/TabsPropControls.tsx | 2 +- .../components/text/TextPropControls.tsx | 2 +- .../TextAreaFieldPropControls.tsx | 2 +- .../textfield/TextFieldPropControls.tsx | 2 +- .../togglebutton/ToggleButtonPropControls.tsx | 2 +- .../components/view/ViewPropControls.tsx | 2 +- .../customization/LabelsAndTextDemo.tsx | 2 +- .../customization/CustomizationComponents.tsx | 2 +- examples/next-app-router/package.json | 2 +- examples/next/package.json | 5 +- .../ai/ai-conversation/context.page.tsx | 2 +- .../with-custom-components/index.page.tsx | 4 +- examples/react-native/package.json | 5 +- package.json | 14 +- packages/configs/.eslintrc.js | 2 +- .../configs/typescript/tsconfig.base.json | 20 +- packages/react-ai/package.json | 4 +- .../AIConversation/AIConversation.tsx | 2 +- .../context/AIContextContext.tsx | 2 +- .../AIConversation/context/ActionsContext.tsx | 2 +- .../context/AttachmentContext.tsx | 2 +- .../AIConversation/context/AvatarsContext.tsx | 2 +- .../context/ControlsContext.tsx | 2 +- .../context/ConversationInputContext.tsx | 2 +- .../context/FallbackComponentContext.tsx | 2 +- .../AIConversation/context/LoadingContext.tsx | 2 +- .../context/MessageVariantContext.tsx | 2 +- .../context/MessagesContext.tsx | 2 +- .../context/ResponseComponentsContext.tsx | 2 +- .../context/SendMessageContext.tsx | 2 +- .../context/SuggestedPromptsContext.tsx | 2 +- .../context/WelcomeMessageContext.tsx | 2 +- .../AIConversation/createAIConversation.tsx | 2 +- .../src/components/AIConversation/types.ts | 8 +- .../views/Controls/AttachmentListControl.tsx | 8 +- .../views/Controls/DefaultMessageControl.tsx | 2 +- .../views/Controls/MessagesControl.tsx | 8 +- .../views/default/Attachments.tsx | 2 +- .../react-ai/src/hooks/useAIConversation.tsx | 4 +- packages/react-auth/package.json | 4 +- packages/react-core-auth/package.json | 2 +- .../ComponentRoute/ComponentRouteContext.tsx | 2 +- .../context/Machine/MachineContext.tsx | 2 +- .../Authenticator/context/Primitives/types.ts | 17 +- .../Authenticator/createProvider/types.ts | 2 +- .../react-core-notifications/package.json | 2 +- packages/react-core/package.json | 4 +- .../context/AuthenticatorProvider.tsx | 2 +- .../__tests__/AuthenticatorProvider.test.tsx | 2 +- .../__snapshots__/useField.spec.ts.snap | 1 + .../__snapshots__/useForm.spec.ts.snap | 1 + .../FormCore/__tests__/useForm.spec.ts | 4 +- .../components/FormCore/withFormProvider.tsx | 10 +- .../RenderNothing/RenderNothing.tsx | 4 +- .../react-core/src/hooks/usePreviousValue.ts | 2 +- packages/react-geo/package.json | 4 +- .../LocationSearch/LocationSearch.tsx | 4 +- packages/react-liveness/package.json | 4 +- .../FaceLivenessDetector.tsx | 2 +- .../FaceLivenessDetectorCore.tsx | 2 +- .../LivenessCheck/LivenessCameraModule.tsx | 2 +- .../FaceLivenessDetector/__mocks__/utils.tsx | 2 +- .../FaceLivenessDetectorProvider.tsx | 2 +- .../shared/DefaultStartScreenComponents.tsx | 6 +- .../shared/FaceLivenessErrorModal.tsx | 2 +- packages/react-liveness/tsconfig.json | 1 + packages/react-native-auth/package.json | 2 +- packages/react-native/package.json | 2 +- .../src/Authenticator/Authenticator.tsx | 2 +- .../ConfirmResetPassword.tsx | 2 +- .../__tests__/ConfirmResetPassword.spec.tsx | 2 +- .../Defaults/ConfirmSignIn/ConfirmSignIn.tsx | 2 +- .../__tests__/ConfirmSignIn.spec.tsx | 2 +- .../Defaults/ConfirmSignUp/ConfirmSignUp.tsx | 2 +- .../ConfirmVerifyUser/ConfirmVerifyUser.tsx | 2 +- .../ForceNewPassword/ForceNewPassword.tsx | 2 +- .../ForgotPassword/ForgotPassword.tsx | 2 +- .../__tests__/ForgotPassword.spec.tsx | 2 +- .../Defaults/SetupTotp/SetupTotp.tsx | 2 +- .../Authenticator/Defaults/SignIn/SignIn.tsx | 2 +- .../Defaults/SignIn/__tests__/SignIn.spec.tsx | 2 +- .../Authenticator/Defaults/SignUp/SignUp.tsx | 2 +- .../Defaults/SignUp/__tests__/SignUp.spec.tsx | 2 +- .../Defaults/VerifyUser/VerifyUser.tsx | 2 +- .../DefaultContainer/DefaultContainer.tsx | 2 +- .../DefaultContainer/InnerContainer.tsx | 2 +- .../common/DefaultContent/DefaultContent.tsx | 2 +- .../common/DefaultFooter/DefaultFooter.tsx | 2 +- .../DefaultRadioFormFields.tsx | 2 +- .../DefaultTextFormFields.tsx | 2 +- .../common/DefaultFormFields/Field.tsx | 2 +- .../common/DefaultFormFields/FieldErrors.tsx | 2 +- .../common/DefaultHeader/DefaultHeader.tsx | 2 +- .../FederatedProviderButton.tsx | 2 +- .../FederatedProviderButtons.tsx | 2 +- .../src/Authenticator/withAuthenticator.tsx | 4 +- .../BannerMessage/BannerMessage.tsx | 2 +- .../CarouselMessage/CarouselMessage.tsx | 2 +- .../CarouselMessage/CarouselMessageItem.tsx | 2 +- .../FullScreenMessage/FullScreenMessage.tsx | 2 +- .../InAppMessageDisplay.tsx | 2 +- .../MessageLayout/MessageLayout.tsx | 2 +- .../MessageWrapper/MessageWrapper.tsx | 2 +- .../components/ModalMessage/ModalMessage.tsx | 2 +- .../withInAppMessaging/withInAppMessaging.tsx | 4 +- .../src/primitives/Button/Button.tsx | 2 +- .../src/primitives/Carousel/Carousel.tsx | 2 +- .../Carousel/CarouselPageIndicator.tsx | 2 +- .../src/primitives/Checkbox/Checkbox.tsx | 2 +- .../src/primitives/Divider/Divider.tsx | 2 +- .../primitives/ErrorMessage/ErrorMessage.tsx | 2 +- .../src/primitives/Heading/Heading.tsx | 2 +- .../react-native/src/primitives/Icon/Icon.tsx | 2 +- .../src/primitives/IconButton/IconButton.tsx | 2 +- .../src/primitives/Label/Label.tsx | 2 +- .../PasswordField/PasswordField.tsx | 2 +- .../PhoneNumberField/PhoneNumberField.tsx | 2 +- .../src/primitives/Radio/Radio.tsx | 2 +- .../src/primitives/RadioGroup/RadioGroup.tsx | 2 +- .../react-native/src/primitives/Tabs/Tab.tsx | 2 +- .../react-native/src/primitives/Tabs/Tabs.tsx | 2 +- .../src/primitives/TextField/TextField.tsx | 2 +- .../react-native/src/theme/ThemeProvider.tsx | 2 +- packages/react-notifications/package.json | 4 +- .../InAppMessaging/Backdrop/Backdrop.tsx | 5 +- .../InAppMessaging/Backdrop/withBackdrop.tsx | 6 +- .../BannerMessage/BannerMessage.tsx | 4 +- .../CloseIconButton/CloseIconButton.tsx | 2 +- .../FullScreenMessage/FullScreenMessage.tsx | 2 +- .../InAppMessageDisplay.tsx | 2 +- .../MessageLayout/MessageLayout.tsx | 2 +- .../ModalMessage/ModalMessage.tsx | 4 +- .../withInAppMessaging/withInAppMessaging.tsx | 4 +- packages/react-storage/package.json | 8 +- .../components/FileUploader/FileUploader.tsx | 2 +- .../hooks/useFileUploader/useFileUploader.ts | 6 +- .../FileUploader/ui/Container/Container.tsx | 2 +- .../ui/Container/__tests__/Container.spec.tsx | 2 +- .../FileUploader/ui/DropZone/DropZone.tsx | 2 +- .../FileUploader/ui/FileList/FileControl.tsx | 2 +- .../FileUploader/ui/FileList/FileDetails.tsx | 2 +- .../FileUploader/ui/FileList/FileList.tsx | 2 +- .../ui/FileList/FileRemoveButton.tsx | 2 +- .../ui/FileList/FileStatusMessage.tsx | 2 +- .../ui/FileList/FileThumbnail.tsx | 2 +- .../ui/FileListFooter/FileListFooter.tsx | 2 +- .../ui/FileListHeader/FileListHeader.tsx | 2 +- .../FileUploader/ui/FilePicker/FilePicker.tsx | 2 +- .../context/elements/defaults.tsx | 2 +- .../components/StorageImage/StorageImage.tsx | 2 +- .../StorageManager/StorageManager.tsx | 2 +- .../StorageManager/ui/Container/Container.tsx | 2 +- .../ui/Container/__tests__/Container.spec.tsx | 2 +- .../StorageManager/ui/DropZone/DropZone.tsx | 2 +- .../ui/FileList/FileControl.tsx | 2 +- .../ui/FileList/FileDetails.tsx | 2 +- .../StorageManager/ui/FileList/FileList.tsx | 2 +- .../ui/FileList/FileRemoveButton.tsx | 2 +- .../ui/FileList/FileStatusMessage.tsx | 2 +- .../ui/FileList/FileThumbnail.tsx | 2 +- .../ui/FileListFooter/FileListFooter.tsx | 2 +- .../ui/FileListHeader/FileListHeader.tsx | 2 +- .../ui/FilePicker/FilePicker.tsx | 2 +- .../__tests__/__snapshots__/exports.ts.snap | 15 + packages/react/package.json | 13 +- .../ChangePassword/ChangePassword.tsx | 2 +- .../AccountSettings/DeleteUser/DeleteUser.tsx | 2 +- .../Authenticator/Authenticator.tsx | 9 +- .../ConfirmSignIn/ConfirmSignIn.tsx | 4 +- .../ConfirmSignUp/ConfirmSignUp.tsx | 4 +- .../FederatedSignIn/FederatedSignIn.tsx | 2 +- .../FederatedSignInButton.tsx | 10 +- .../ForceNewPassword/ForceNewPassword.tsx | 8 +- .../ForgotPassword/ConfirmResetPassword.tsx | 6 +- .../ForgotPassword/ForgotPassword.tsx | 6 +- .../RouteContainer/RouteContainer.tsx | 2 +- .../Authenticator/Router/Router.tsx | 8 +- .../Authenticator/SetupTotp/SetupTotp.tsx | 6 +- .../Authenticator/SignIn/SignIn.tsx | 4 +- .../Authenticator/SignUp/SignUp.tsx | 6 +- .../VerifyUser/ConfirmVerifyUser.tsx | 4 +- .../Authenticator/VerifyUser/VerifyUser.tsx | 8 +- .../useCustomComponents/defaultComponents.tsx | 10 +- .../shared/ConfirmSignInFooter.tsx | 2 +- .../shared/ConfirmationCodeInput.tsx | 2 +- .../Authenticator/shared/FormField.tsx | 2 +- .../Authenticator/shared/FormFields.tsx | 2 +- .../shared/RemoteErrorMessage.tsx | 2 +- .../Authenticator/shared/SignInSignUpTabs.tsx | 2 +- .../shared/TwoButtonSubmitFooter.tsx | 4 +- .../Authenticator/withAuthenticator.tsx | 2 +- .../FilterChildren/FilterChildren.tsx | 2 +- .../ThemeProvider/ComponentStyle.tsx | 2 +- .../components/ThemeProvider/GlobalStyle.tsx | 2 +- .../src/components/ThemeProvider/Style.tsx | 5 +- .../ThemeProvider/ThemeProvider.tsx | 2 +- .../components/ThemeProvider/ThemeStyle.tsx | 2 +- .../components/shared/ValidationErrors.tsx | 2 +- .../react/src/primitives/Alert/AlertIcon.tsx | 2 +- .../__tests__/CheckboxField.test.tsx | 2 +- .../src/primitives/Collection/Collection.tsx | 4 +- .../src/primitives/DropZone/DropZone.tsx | 15 +- .../primitives/DropZone/DropZoneChildren.tsx | 24 +- .../primitives/DropZone/DropZoneProvider.tsx | 2 +- .../primitives/Icon/context/IconsProvider.tsx | 2 +- .../react/src/primitives/Icon/icons/types.ts | 2 +- .../primitives/Link/__tests__/Link.test.tsx | 53 +- .../Pagination/usePaginationItems.tsx | 2 +- .../react/src/primitives/Tabs/TabsList.tsx | 2 +- .../src/primitives/types/autocomplete.ts | 2 +- .../react/src/primitives/types/collection.ts | 4 +- packages/react/src/primitives/types/rating.ts | 4 +- packages/react/src/primitives/types/view.ts | 7 +- .../utils/primitiveWithForwardRef.ts | 2 +- yarn.lock | 664 +++++++++--------- 256 files changed, 767 insertions(+), 807 deletions(-) create mode 100644 .changeset/old-suits-brush.md diff --git a/.changeset/old-suits-brush.md b/.changeset/old-suits-brush.md new file mode 100644 index 00000000000..c9896e14740 --- /dev/null +++ b/.changeset/old-suits-brush.md @@ -0,0 +1,13 @@ +--- +"@aws-amplify/ui-react": patch +"@aws-amplify/ui-react-ai": patch +"@aws-amplify/ui-react-core": patch +"@aws-amplify/ui-react-core-notifications": patch +"@aws-amplify/ui-react-geo": patch +"@aws-amplify/ui-react-liveness": patch +"@aws-amplify/ui-react-native": patch +"@aws-amplify/ui-react-notifications": patch +"@aws-amplify/ui-react-storage": patch +--- + +chore(react): add support for React 19 diff --git a/build-system-tests/templates/components/react-native/cli/App.tsx b/build-system-tests/templates/components/react-native/cli/App.tsx index 6142710083f..3fa7f4a72dd 100644 --- a/build-system-tests/templates/components/react-native/cli/App.tsx +++ b/build-system-tests/templates/components/react-native/cli/App.tsx @@ -23,7 +23,7 @@ function SignOutButton() { return