├── form-handle-with-formik ├── .babelrc ├── .gitignore ├── .watchmanconfig ├── App.js ├── app.json ├── assets │ ├── icon.png │ └── splash.png ├── package.json ├── src │ └── components │ │ └── Input.js └── yarn.lock ├── multi-step-with-compounds ├── .babelrc ├── .gitignore ├── .watchmanconfig ├── App.js ├── README.md ├── app.json ├── assets │ ├── icon.png │ └── splash.png ├── package.json └── src │ └── components │ ├── Input.js │ ├── Step.js │ └── Wizard.js ├── places-search-with-react-native-google-autocomplete ├── .babelrc ├── .gitignore ├── .watchmanconfig ├── App.js ├── app.json ├── assets │ ├── icon.png │ └── splash.png ├── package.json ├── src │ └── components │ │ └── LocationItem.js └── yarn.lock └── redux-persist ├── .babelrc ├── .gitignore ├── .watchmanconfig ├── App.js ├── app.json ├── assets ├── icon.png └── splash.png ├── package.json ├── src ├── UsernameInput.js ├── redux │ ├── index.js │ └── user.js └── store.js ├── yarn-error.log └── yarn.lock /form-handle-with-formik/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["babel-preset-expo"], 3 | "env": { 4 | "development": { 5 | "plugins": ["transform-react-jsx-source"] 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /form-handle-with-formik/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/**/* 2 | .expo/* 3 | npm-debug.* 4 | -------------------------------------------------------------------------------- /form-handle-with-formik/.watchmanconfig: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /form-handle-with-formik/App.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { StyleSheet, Text, View, Alert } from 'react-native'; 3 | import { Button } from 'react-native-elements'; 4 | import { Formik } from 'formik'; 5 | import * as Yup from 'yup'; 6 | 7 | import Input from './src/components/Input'; 8 | 9 | const api = user => 10 | new Promise((resolve, reject) => { 11 | setTimeout(() => { 12 | if (user.email === 'hello@gmail.com') { 13 | reject({ email: 'Email already use' }); 14 | } else { 15 | resolve(); 16 | } 17 | }, 3000); 18 | }); 19 | 20 | export default class App extends React.Component { 21 | _handleSubmit = async (values, bag) => { 22 | try { 23 | await api(values); 24 | Alert.alert('Welcome'); 25 | } catch (error) { 26 | bag.setSubmitting(false); 27 | bag.setErrors(error); 28 | } 29 | }; 30 | render() { 31 | return ( 32 | 33 | ( 60 | 61 | 70 | 80 | 90 |