Skip to content

Commit

Permalink
chore: update react import & updated factory methods for import colle…
Browse files Browse the repository at this point in the history
…ction (#551)
  • Loading branch information
SwaySway authored Jul 29, 2022
1 parent 9a80f3d commit ec907fc
Show file tree
Hide file tree
Showing 5 changed files with 171 additions and 133 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ exports[`react-studio-template-renderer-helper transpile fails to transpile with
exports[`react-studio-template-renderer-helper transpile fails to transpile with ScriptTarget Latest 1`] = `"ScriptTarget 99 not supported with type declarations enabled, expected one of [0,1,2,3,4,5,6,7,8]"`;

exports[`react-studio-template-renderer-helper transpile successfully transpiles with ScriptTarget ES3 1`] = `
"import React from \\"react\\";
"import * as React from \\"react\\";
import { EscapeHatchProps } from \\"@aws-amplify/ui-react/internal\\";
import { ViewTestProps } from \\"./ViewTest\\";
export declare type CustomParentAndChildrenProps = React.PropsWithChildren<Partial<ViewTestProps> & {
Expand All @@ -24,7 +24,7 @@ export default function CustomParentAndChildren(props: CustomParentAndChildrenPr
`;
exports[`react-studio-template-renderer-helper transpile successfully transpiles with ScriptTarget ES5 1`] = `
"import React from \\"react\\";
"import * as React from \\"react\\";
import { EscapeHatchProps } from \\"@aws-amplify/ui-react/internal\\";
import { ViewTestProps } from \\"./ViewTest\\";
export declare type CustomParentAndChildrenProps = React.PropsWithChildren<Partial<ViewTestProps> & {
Expand All @@ -35,7 +35,7 @@ export default function CustomParentAndChildren(props: CustomParentAndChildrenPr
`;
exports[`react-studio-template-renderer-helper transpile successfully transpiles with ScriptTarget ES2015 1`] = `
"import React from \\"react\\";
"import * as React from \\"react\\";
import { EscapeHatchProps } from \\"@aws-amplify/ui-react/internal\\";
import { ViewTestProps } from \\"./ViewTest\\";
export declare type CustomParentAndChildrenProps = React.PropsWithChildren<Partial<ViewTestProps> & {
Expand All @@ -46,7 +46,7 @@ export default function CustomParentAndChildren(props: CustomParentAndChildrenPr
`;
exports[`react-studio-template-renderer-helper transpile successfully transpiles with ScriptTarget ES2016 1`] = `
"import React from \\"react\\";
"import * as React from \\"react\\";
import { EscapeHatchProps } from \\"@aws-amplify/ui-react/internal\\";
import { ViewTestProps } from \\"./ViewTest\\";
export declare type CustomParentAndChildrenProps = React.PropsWithChildren<Partial<ViewTestProps> & {
Expand All @@ -57,7 +57,7 @@ export default function CustomParentAndChildren(props: CustomParentAndChildrenPr
`;
exports[`react-studio-template-renderer-helper transpile successfully transpiles with ScriptTarget ES2017 1`] = `
"import React from \\"react\\";
"import * as React from \\"react\\";
import { EscapeHatchProps } from \\"@aws-amplify/ui-react/internal\\";
import { ViewTestProps } from \\"./ViewTest\\";
export declare type CustomParentAndChildrenProps = React.PropsWithChildren<Partial<ViewTestProps> & {
Expand All @@ -68,7 +68,7 @@ export default function CustomParentAndChildren(props: CustomParentAndChildrenPr
`;
exports[`react-studio-template-renderer-helper transpile successfully transpiles with ScriptTarget ES2018 1`] = `
"import React from \\"react\\";
"import * as React from \\"react\\";
import { EscapeHatchProps } from \\"@aws-amplify/ui-react/internal\\";
import { ViewTestProps } from \\"./ViewTest\\";
export declare type CustomParentAndChildrenProps = React.PropsWithChildren<Partial<ViewTestProps> & {
Expand All @@ -79,7 +79,7 @@ export default function CustomParentAndChildren(props: CustomParentAndChildrenPr
`;
exports[`react-studio-template-renderer-helper transpile successfully transpiles with ScriptTarget ES2019 1`] = `
"import React from \\"react\\";
"import * as React from \\"react\\";
import { EscapeHatchProps } from \\"@aws-amplify/ui-react/internal\\";
import { ViewTestProps } from \\"./ViewTest\\";
export declare type CustomParentAndChildrenProps = React.PropsWithChildren<Partial<ViewTestProps> & {
Expand All @@ -90,7 +90,7 @@ export default function CustomParentAndChildren(props: CustomParentAndChildrenPr
`;
exports[`react-studio-template-renderer-helper transpile successfully transpiles with ScriptTarget ES2020 1`] = `
"import React from \\"react\\";
"import * as React from \\"react\\";
import { EscapeHatchProps } from \\"@aws-amplify/ui-react/internal\\";
import { ViewTestProps } from \\"./ViewTest\\";
export declare type CustomParentAndChildrenProps = React.PropsWithChildren<Partial<ViewTestProps> & {
Expand All @@ -101,7 +101,7 @@ export default function CustomParentAndChildren(props: CustomParentAndChildrenPr
`;
exports[`react-studio-template-renderer-helper transpile successfully transpiles with ScriptTarget ES2021 1`] = `
"import React from \\"react\\";
"import * as React from \\"react\\";
import { EscapeHatchProps } from \\"@aws-amplify/ui-react/internal\\";
import { ViewTestProps } from \\"./ViewTest\\";
export declare type CustomParentAndChildrenProps = React.PropsWithChildren<Partial<ViewTestProps> & {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

exports[`amplify form renderer tests custom form tests should render a custom backed form 1`] = `
"/* eslint-disable */
import React from \\"react\\";
import * as React from \\"react\\";
import { validateField } from \\"./utils.js\\";
import {
getOverrideProps,
Expand Down Expand Up @@ -135,7 +135,7 @@ export default function customDataForm(props) {
`;
exports[`amplify form renderer tests custom form tests should render a custom backed form 2`] = `
"import React from \\"react\\";
"import * as React from \\"react\\";
import { EscapeHatchProps } from \\"@aws-amplify/ui-react/internal\\";
export declare type customDataFormProps = React.PropsWithChildren<{
overrides?: EscapeHatchProps | undefined | null;
Expand All @@ -149,7 +149,7 @@ export default function customDataForm(props: customDataFormProps): React.ReactE
exports[`amplify form renderer tests datastore form tests should generate a create form 1`] = `
"/* eslint-disable */
import React from \\"react\\";
import * as React from \\"react\\";
import { validateField } from \\"./utils.js\\";
import {
getOverrideProps,
Expand Down Expand Up @@ -360,7 +360,7 @@ export default function myPostForm(props) {
`;
exports[`amplify form renderer tests datastore form tests should generate a create form 2`] = `
"import React from \\"react\\";
"import * as React from \\"react\\";
import { EscapeHatchProps } from \\"@aws-amplify/ui-react/internal\\";
export declare type myPostFormProps = React.PropsWithChildren<{
overrides?: EscapeHatchProps | undefined | null;
Expand All @@ -378,7 +378,7 @@ export default function myPostForm(props: myPostFormProps): React.ReactElement;
exports[`amplify form renderer tests datastore form tests should generate a update form 1`] = `
"/* eslint-disable */
import React from \\"react\\";
import * as React from \\"react\\";
import { validateField } from \\"./utils.js\\";
import {
getOverrideProps,
Expand Down Expand Up @@ -590,7 +590,7 @@ export default function myPostForm(props) {
`;
exports[`amplify form renderer tests datastore form tests should generate a update form 2`] = `
"import React from \\"react\\";
"import * as React from \\"react\\";
import { EscapeHatchProps } from \\"@aws-amplify/ui-react/internal\\";
export declare type myPostFormProps = React.PropsWithChildren<{
overrides?: EscapeHatchProps | undefined | null;
Expand Down
Loading

0 comments on commit ec907fc

Please sign in to comment.