title: How can I check the text value when I press on button, rather than whenever text changes?
body: <p>I put an input and a button. I want it to go to Home Screen if the password in input is correct when i press on button. But whenever I type in input, it checks the password if its correct,</p>
  <p>I am using react native base tho.</p>
  <p>How to solve this issue?</p>
  <pre><code>import React, { useState } from &quot;react&quot;;
  import { View, StyleSheet, TextInput, Alert } from &quot;react-native&quot;;
  import { Container, Header, Content, Form, Item, Input, Label, Button, Text } from 'native-base';
  const SplashScreen = ({ navigation }) =&gt; {
   
    const [password, setPassword] = useState('');
    
    const CORRECT_PASSWORD = &quot;5555&quot;;
    const onEnterPin = (password)=&gt;{
        if(password === CORRECT_PASSWORD) {
        
          navigation.navigate(&quot;Home&quot;);
        }
        else{
          Alert.alert(&quot;please check your password&quot;)
        }
    };
  
    return (
      &lt;Container&gt;
        &lt;Header /&gt;
        &lt;Content&gt;
          &lt;Form&gt;
            &lt;Item stackedLabel last&gt;
              &lt;Label&gt;Enter Password&lt;/Label&gt;
              &lt;Input style={{ borderWidth: .1 }} onChangeText={(text) =&gt; setPassword(text)} /&gt;
            &lt;/Item&gt;
            &lt;Button block onPress={onEnterPin(password)}&gt;
              &lt;Text&gt;Go Home Screen&lt;/Text&gt;
            &lt;/Button&gt;
          &lt;/Form&gt;
        &lt;/Content&gt;
      &lt;/Container&gt;   
    )
  }
  
  export default SplashScreen;
  </code></pre>