title: Uncaught TypeError: object is not iterable (cannot read property Symbol(Symbol.iterator))
body: <p>I'm not sure why I'm getting this error. I'm new to react and I created this simple form but it's gives error on rendering. It's four field input form where I'm using HANDLECHANGE function on onChange of each input and getting all the values according to their name, Used handleSubmit function to avoid the normal behavior of form. handleSubmit is not the issue factor but still I tried removing it but the code still doesn't work.Please let me know if I'm doing something stupid. Here are my files for the code.</p>
  <pre><code>import React from &quot;react&quot;;
  import useForm from &quot;./useForm&quot;;
  
  function FormSignup() {
    const [values, handleChange, handleSubmit] = useForm();
  
    return (
      &lt;div className=&quot;formContent&quot;&gt;
        &lt;form className=&quot;form&quot; onSubmit={handleSubmit}&gt;
          &lt;h1&gt;Get Started with us today!&lt;/h1&gt;
          &lt;div className=&quot;formElements&quot;&gt;
            &lt;label htmlFor=&quot;username&quot; className=&quot;formLabel&quot;&gt;
              Username
            &lt;/label&gt;
            &lt;input
              type=&quot;text&quot;
              name=&quot;username&quot;
              className=&quot;Inputs&quot;
              onChange={handleChange}
              value={values.username}
              placeholder=&quot;Enter your username&quot;
            /&gt;
            &lt;label htmlFor=&quot;email&quot; className=&quot;formLabel&quot;&gt;
              Email
            &lt;/label&gt;
            &lt;input
              type=&quot;email&quot;
              name=&quot;email&quot;
              className=&quot;Inputs&quot;
              onChange={handleChange}
              value={values.email}
              placeholder=&quot;Enter your email&quot;
            /&gt;
            &lt;label htmlFor=&quot;password&quot; className=&quot;formLabel&quot;&gt;
              Password
            &lt;/label&gt;
            &lt;input
              type=&quot;password&quot;
              name=&quot;password&quot;
              className=&quot;Inputs&quot;
              onChange={handleChange}
              value={values.password}
              placeholder=&quot;Enter your password&quot;
            /&gt;
            &lt;label htmlFor=&quot;password2&quot; className=&quot;formLabel&quot;&gt;
              Confirm Password
            &lt;/label&gt;
            &lt;input
              type=&quot;password&quot;
              name=&quot;password2&quot;
              className=&quot;Inputs&quot;
              onChange={handleChange}
              value={values.password2}
              placeholder=&quot;Confirm your password&quot;
            /&gt;
            &lt;button className=&quot;formButton&quot; type=&quot;submit&quot;&gt;
              SignUp
            &lt;/button&gt;
          &lt;/div&gt;
        &lt;/form&gt;
      &lt;/div&gt;
    );
  }
  
  export default FormSignup;
  </code></pre>
  <p>In my useform file I'm handling the form input with state hook. Wondering if I did something wrong here.</p>
  <pre><code>import { useState } from &quot;react&quot;;
  
  const useForm = () =&gt; {
    const [values, setValues] = useState({
      username: &quot;&quot;,
      email: &quot;&quot;,
      password: &quot;&quot;,
      password2: &quot;&quot;,
    });
  
    const handleChange = (e) =&gt; {
      const { name, value } = e.target;
      setValues({ ...values, [name]: value });
    };
    function handleSubmit(e) {
      e.preventdefault();
    }
    return {
      handleChange,
      values,
      handleSubmit,
    };
  };
  
  export default useForm;
  </code></pre>