How to decode "secureTextEntry" textinput in react native

Viewed 21

I am using TextInput in react native. There is a property secureTextEntry for password type.

Problem is, that this field returns dots in onChangeText function instead of my text -> ••••••••••••a

How can I decode this string?

I need to send this password into my server POST /login route, but I can't because it is hiden with dots.

1 Answers

use the TextInput like in the example below, you should not have problems..

const [password, setPassword] = useState('');

 <TextInput
  placeholder="Password"
  secureTextEntry={true}
  onChangeText={setPassword}
  {password}
 </TextInput>
Related