Disable textinput in react-native application

How to disable textinput in react-native

In this article, we learn about Disable Option on React-Native TextInput, for this, you have to add editable={false} and selectTextOnFocus={false} to disable TextInput in react-native, let’s look at the code


1. Create a new project

2. Imports following component

3. Add editable={false} and selectTextOnFocus={false}

Add the TextInput component in return method as follows

I have added two TextInput one for Enable and another for disable TextInput, make sure each TextInput should be inside view, and assign a style to its view because borderRadius is not worked in iOS if you directly assign to TextInput, let’s look at following App.js code

4. App.js

5. Output

Here is the final output

Thank you… 🙂

2 Replies to “Disable textinput in react-native application”

Leave a Reply

Your email address will not be published. Required fields are marked *