2. TextInput #

Created Tue Dec 5, 2023 at 1:02 AM

https://reactnative.dev/docs/textinput

Basic #

import { TextInput } from 'react-native';

<TextInput
  value=""
  onChangeText={(newText) => {}}

  placeholder=""
  keyboardType="numeric" // | 'dialpad' | 'default'
  maxLength={10}

  clearButtonMode="never" // 'while-editing' | 'unless-editing' | 'always'
/>

Wrapper usually needed #

Projects usually have a wrapper they use (instead of directly using <TextInput />)

Reason being that <TextInput /> has no styles (invisible) by default. And also that RN has no style inheritance.