Disable Textinput in React native

In this article, we learn about Disable Option on React-Native TextInput. As a developer we need to disble React native TextInput view  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. Disable Textinput

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

Disable Textinput in React native

Thank you… 🙂

2 Replies to “Disable Textinput in React native”

Leave a Reply

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