Collecting text input
It turns out that there's a lot to think about when it comes to implementing text inputs. For example, should it have placeholder text? Is this sensitive data that shouldn't be displayed on the screen? Should you process text as it's entered or when the user moves to another field?
The noticeable difference between mobile text input and traditional web text input is that the former has its own built-in virtual keyboard that you can configure and respond to. Let's build an example that renders several instances of the <TextInput>
component:
import React, { useState } from "react"; import PropTypes from "prop-types"; import { Text, TextInput, View } from "react-native"; import styles from "./styles"; function Input(props) { return ( <View style={styles.textInputContainer}> <Text style={styles.textInputLabel}>...