Reputation: 260
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
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