title: How to pass an array of numbers using e.target.value and React useState Hooks?
body: <p>I want to pass a numbers array like [2,4,5,5,3,7,4,7,0,4] into submitNumbers(), I'm trying to update numbers using an onChange event. it works if I pass the whole array without using the useState(). Trying to console.log these constants while running returns not defined.</p>
  <pre><code>   function App() {
        
        const [userAccount, setUserAccount] = useState()
        const [amount, setAmount] = useState()
        const [numbers, setNumbersValue] = useState()
        //const numbers = [2,4,5,5,3,7,4,7,0,4]
      
        async function setNumbers() {
          if (typeof window.ethereum !== 'undefined') {
            await requestAccount()
            const provider = new ethers.providers.Web3Provider(window.ethereum);
            const signer = provider.getSigner();
            const contract = new ethers.Contract(Address, Contract.abi, signer);
            const transaction = await contract.submitNumbers(numbers);
            await transaction.wait()
            //fetchNumbers()
          }
        }
      
       return (
      
          &lt;button onClick={e =&gt; setNumbers()}&gt;Set Numbers&lt;/button&gt;
          &lt;input onChange={e =&gt; setNumbersValue(e.target.value)} placeholder=&quot;Numbers&quot; /&gt;
    );
  )
      
  export default App;
  </code></pre>