I'm building a form for login that contains username and password fields with React Native using the TextInput component and for the password field, I'm passing the secureTextEntry prop as follows:
<TextInput
value={password}
onChangeText={(e)=>setPassword(e)}
style={styles.password}
secureTextEntry={true}
But I faced an issue where fontFamily style is not applying on the TextInput with secureTextEntry prop. I figured out a solution that worked ONLY on IOS but NOT on Android by writing the following:
added ref={ref => ref_1 = ref}
prop for password textInput so it becomes as follows:
<TextInput
value={password}
onChangeText={(e)=>setPassword(e)}
style={styles.password}
secureTextEntry={true}
ref={ref => ref_1 = ref}
trying to set the style on useEffect
let ref_1 = useRef(null)
useEffect(()=>{
ref_1.setNativeProps({
style:{
fontFamily:fonts.dinRegular
}
})
},[])
But now I have a bug where the whole placeholder is disappearing on ANDROID completely but working perfectly on IOS...
Any other suggestions please?