diff --git a/example/project/app/App.tsx b/example/project/app/App.tsx index c9efe366..ce998b8e 100644 --- a/example/project/app/App.tsx +++ b/example/project/app/App.tsx @@ -4,6 +4,7 @@ import PageHeader from '@availity/page-header'; import { Container, Card } from 'reactstrap'; import * as yup from 'yup'; import Form from '@/components/Form'; +import chain from '@/chain'; const App: React.SFC<{}> = () => ( @@ -12,9 +13,11 @@ const App: React.SFC<{}> = () => ( tag={Formik} initialValues={{ formField: '', + chainedField: chain, }} validationSchema={yup.object().shape({ formField: yup.string().required('This field is required.'), + chainedField: yup.string().required('This field is required.'), })} render={Form} /> diff --git a/example/project/app/chain.js b/example/project/app/chain.js new file mode 100644 index 00000000..86a003a4 --- /dev/null +++ b/example/project/app/chain.js @@ -0,0 +1,14 @@ +// Simple .js file to test compiling and linting for @babel/plugin-proposal-optional-chaining + +const chainObject = { + org: { + types: [ + { + name: 'Availity', + }, + ], + }, +}; + +const chain = chainObject.org?.types?.[0]?.name; +export default chain; diff --git a/example/project/app/components/Form.tsx b/example/project/app/components/Form.tsx index 0acd03d5..707e8493 100644 --- a/example/project/app/components/Form.tsx +++ b/example/project/app/components/Form.tsx @@ -11,6 +11,7 @@ const Form: React.SFC> = ({ handleSubmit, handleReset }) +