Created
March 16, 2021 03:26
-
-
Save antoniomesquita09/38644342d6ea5056b921b5f1ea5912e4 to your computer and use it in GitHub Desktop.
Basic form using exemples of keyboard type.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useState } from "react"; | |
import { SafeAreaView, StyleSheet, TextInput } from "react-native"; | |
const Form = () => { | |
const [phone, onChangePhone] = useState(null); | |
const [email, onChangeEmail] = useState(null); | |
const [url, onChangeUrl] = useState(null); | |
return ( | |
<SafeAreaView> | |
<TextInput | |
style={styles.input} | |
onChangeText={onChangeUrl} | |
value={url} | |
keyboardType="url" | |
/> | |
<TextInput | |
style={styles.input} | |
onChangeText={onChangeEmail} | |
value={email} | |
placeholder="Type your email" | |
keyboardType="email-address" | |
/> | |
<TextInput | |
style={styles.input} | |
onChangeText={onChangePhone} | |
value={phone} | |
placeholder="Type your phone" | |
keyboardType="numeric" | |
/> | |
</SafeAreaView> | |
); | |
}; | |
export default Form; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment