Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React native elements form Secure text entry

Tags:

react-native

I want to use a react native elements form for a text input for user passwords. My code is here:

<FormLabel> Passsword </FormLabel>
<FormInput 
onChangeText - {(text) => this.setState({password: text})}
/>

How can I make the text they enter secure so nobody can see what it is. For textInput they have secureTextEntry but I have not been able to find something similar for react native elements

like image 330
paulgio Avatar asked Jul 18 '18 21:07

paulgio


2 Answers

React Native Elements Input inherits all native TextInput props from React Native:

see: https://react-native-training.github.io/react-native-elements/docs/input.html#props

So this works fine:

import { Input } from 'react-native-elements'

<Input placeholder="password" secureTextEntry={true} />
like image 146
Roland Avatar answered Oct 02 '22 05:10

Roland


Use TextInput's property secureTextEntry for to hide the password field

            <TextInput
                   .....
                    secureTextEntry={true}  
                />

This field accepts boolean value true for hide the text and false for to show the text

like image 37
Jay Thummar Avatar answered Oct 02 '22 07:10

Jay Thummar