From b98a8f452bfa658f1c58ebe6a5e75fece40d72d9 Mon Sep 17 00:00:00 2001 From: Alexander Harris Date: Mon, 31 Jan 2022 18:05:54 -0800 Subject: [PATCH] fix: add missing import statement, and correct controlled component state tracking --- .../studio-ui-codegen-react.test.ts.snap | 6 +- .../lib/imports/import-mapping.ts | 12 ++++ .../lib/react-component-renderer.ts | 11 ++-- .../react-component-with-children-renderer.ts | 11 ++-- .../lib/react-studio-template-renderer.ts | 2 +- .../codegen-ui-react/lib/workflow/action.ts | 24 ++++---- .../codegen-ui-react/lib/workflow/mutation.ts | 56 ++++++++++++++++++- .../workflow/authSignOutAction.json | 29 +++++----- .../workflow/dataStoreCreateItem.json | 1 - .../workflow/dataStoreDeleteItem.json | 1 - .../workflow/dataStoreUpdateItem.json | 1 - 11 files changed, 112 insertions(+), 42 deletions(-) diff --git a/packages/codegen-ui-react/lib/__tests__/__snapshots__/studio-ui-codegen-react.test.ts.snap b/packages/codegen-ui-react/lib/__tests__/__snapshots__/studio-ui-codegen-react.test.ts.snap index ac30ff607..c19e73fee 100644 --- a/packages/codegen-ui-react/lib/__tests__/__snapshots__/studio-ui-codegen-react.test.ts.snap +++ b/packages/codegen-ui-react/lib/__tests__/__snapshots__/studio-ui-codegen-react.test.ts.snap @@ -5167,6 +5167,7 @@ import { EscapeHatchProps, getOverrideProps, useDataStoreUpdateAction, + useStateMutationAction, } from \\"@aws-amplify/ui-react/internal\\"; import { Button, Flex, FlexProps, TextField } from \\"@aws-amplify/ui-react\\"; import { Customer } from \\"../models\\"; @@ -5191,7 +5192,9 @@ export default function MyForm(props: MyFormProps): React.ReactElement { { + setUsernameTextFieldValue(event.target.value); + }} {...getOverrideProps(overrides, \\"UsernameTextField\\")} >