-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathindex.js
More file actions
31 lines (27 loc) · 744 Bytes
/
index.js
File metadata and controls
31 lines (27 loc) · 744 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import React from 'react';
import { Alert, StyleSheet } from 'react-native';
import Form4u from 'react-native-form4u';
import formFields from './testFields';
import validationRules from './validationRules';
const Test = () => {
const handleSubmit = (state) => {
const {
firstName, lastName, email, subject, password,
} = state;
Alert.alert(
'Your info',
`First Name: ${firstName.value}\n Last Name: ${lastName.value}\n Email: ${
email.value
}\n Subject: ${subject.value} \n Password: ${password.value}`,
);
};
return (
<Form4u
formFields={formFields}
handleSubmit={handleSubmit}
validation={validationRules}
submitOnDirty
/>
);
};
export default Test;