While I hide my password in react-native password freezes to the beginning

const [password, setPassword] = useState('')
const [passwordVisibility, setPasswordVisibility] = useState(false);
<View style={styles.inputContainer}>
          <TextInput
            name="password"
            style={styles.inputField}
            autoCapitalize='none'
            value={password}
            autoCorrect={false}
            textContentType="newPassword"
            onChangeText={onChangeText}
            placeholder="Password"
            enablesReturnKeyAutomatically
            secureTextEntry={passwordVisibility}
          />
          <Pressable onPress={()=>{setPasswordVisibility(!passwordVisibility) , console.log(password)}}>
          <Icon name={passwordVisibility == true ? 'eye' : 'eye-off' } size={23} color='purple' />
          </Pressable>
          
        </View>

Here is my code .While I hide my password in react-native password freezes to the beginning . How can I fix this