title: How to use React Native basic hooks example?
body: <p>I recently started app development with React Native. Therefore I am trying to implement a button that switches between two boolean states with values via hooks. Right now the button works once, but I can't toggle the value back. I am trying to create a custom button, so the switch from React is not an option. Do you have any fixes or tips for me?</p>
  <pre><code>import React, { useState } from 'react';
  import { Button, View,Text } from 'react-native';
  
  export const Notes =({}) =&gt; { 
   //   
      const [score, setScore] = useState(1);
  
      const handlepress = () =&gt; {
          score ? setScore(1): setScore(2);
      }
      return (    
          &lt;View&gt;  
          &lt;Text&gt;{score}&lt;/Text&gt;
              &lt;Button title= &quot;Take Number&quot; onPress= {handlepress}&gt;
              &lt;/Button&gt;    
              &lt;Text&gt; Test{score}&lt;/Text&gt;
          &lt;/View&gt;    
  );}
  </code></pre>