Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

formik react native

// Formik x React Native example
2 import React from 'react';
3 import { Button, TextInput, View } from 'react-native';
4 import { Formik } from 'formik';
5 
6 export const MyReactNativeForm = props => (
7   <Formik
8     initialValues={{ email: '' }}
9     onSubmit={values => console.log(values)}
10   >
11     {({ handleChange, handleBlur, handleSubmit, values }) => (
12       <View>
13         <TextInput
14           onChangeText={handleChange('email')}
15           onBlur={handleBlur('email')}
16           value={values.email}
17         />
18         <Button onPress={handleSubmit} title="Submit" />
19       </View>
20     )}
21   </Formik>
22 );
Source by formik.org #
 
PREVIOUS NEXT
Tagged: #formik #react #native
ADD COMMENT
Topic
Name
6+9 =