Skip to content

Instantly share code, notes, and snippets.

@antoniomesquita09
Created March 16, 2021 03:26
Show Gist options
  • Save antoniomesquita09/38644342d6ea5056b921b5f1ea5912e4 to your computer and use it in GitHub Desktop.
Save antoniomesquita09/38644342d6ea5056b921b5f1ea5912e4 to your computer and use it in GitHub Desktop.
Basic form using exemples of keyboard type.
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