ifelsething logoifelsething

How to Disable Auto Correct in React Native TextInput?

Posted By: Harish
How to Disable Auto Correct in React Native TextInput

Auto correct feature of an android or iOS keyboard not needed sometimes. You can use autoCorrect prop of <TextInput> to simply disable auto correct in the TextInput field.

Create A New Project

Create a new react-native project by using npx. Check documentation for creating a new react native project.

npx react-native@latest init TextInputRN

Add a TextInput Field and autoCorrect Prop

Let's add a <TextInput> field and add autoCorrect prop to TextInput.

Add autoCorrect={true}, if auto correct functionality is needed. Default value is true, so there is no need to add a prop for auto correct.

//app.tsx
import {TextInput} from 'react-native';

...

<TextInput
  style={styles.input}
  autoCorrect={true}
/>
disable auto correct in react native textinput field

Add autoCorrect={false}, to disable auto correct feature in text input field on both android and iOS.

<TextInput
  style={styles.input}
  autoCorrect={false}
/>
disable auto correct in react native textinput field

Share is Caring

Related Posts