import React, {useState} from 'react'; import FloatingLabelTextInput from '../../src/floatingLabelTextInput'; //@ts-ignore import FontisoIcon from 'react-native-vector-icons/Fontisto'; import FontAwesome5Icon from 'react-native-vector-icons/FontAwesome5'; function WithIcon() { const [showPassword, setShowPassword] = useState(true); return ( console.log('Icon pressed')} /> } rightIcon={ !showPassword ? ( setShowPassword((s: boolean) => !s)} /> ) : ( setShowPassword((s: boolean) => !s)} /> ) } secureTextEntry={showPassword} /> ); } export default WithIcon;