Skip to content

Commit

Permalink
Update shared example to use ref
Browse files Browse the repository at this point in the history
  • Loading branch information
JDMathew committed Aug 1, 2024
1 parent 2e5be6b commit 5edca74
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions examples/shared/src/screens/Form.screen.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Form, TextInput } from '@react-native-ama/forms';
import { Form, FormActions, TextInput } from '@react-native-ama/forms';
import { Text } from '@react-native-ama/react-native';
import * as React from 'react';
import { ScrollView, StyleSheet } from 'react-native';
Expand All @@ -12,6 +12,7 @@ export const FormScreen = () => {
const [firstName, setFirstName] = React.useState('');
const [lastName, setLastName] = React.useState('');
const [testKeyboardTrap, setTestKeyboardTrap] = React.useState(false);
const formRef = React.useRef<FormActions>(null);
const [invalidFields, setInvalidFields] = React.useState<{
lastName: boolean;
firstName: boolean;
Expand All @@ -36,7 +37,7 @@ export const FormScreen = () => {

return (
<ScrollView style={styles.view}>
<Form onSubmit={handleOnSubmit}>
<Form onSubmit={handleOnSubmit} ref={formRef}>
<TextInput
style={styles.input}
placeholder=""
Expand Down

0 comments on commit 5edca74

Please sign in to comment.