user2564429
user2564429

Reputation: 260

react-native textinput securetextentry star instead of dots

Is there a way to change the style of textInput in react-native when secureTextEntry is true. I want to display stars(*) instead of dots for hidden texts.

Upvotes: 7

Views: 2247

Answers (1)

Bruno Mazzardo
Bruno Mazzardo

Reputation: 1586

You can implement your own TextInput, a component that renders a textInput, but changes the value to *, based on the length of the input, that you can store on state

<SecureInput value = {this.state} onTextChange = {callbackToUpdateState}/>

and on SecureInput, you can <TextInput/> with the value being a star for each char of the value

Upvotes: 0

Related Questions