title: Getting Uncaught TypeError: path.split is not a function in react
body: <p>I'm trying to do validations for my form in react. I chose &quot;react-hook-form&quot; library. But I'm constantly getting error &quot;Path.split is not a function. Even after using the default example given in their website, I'm getting the same error.
  This is the default code given in the official site.</p>
  <pre class="lang-js prettyprint-override"><code>import React from &quot;react&quot;;
  import { useForm } from &quot;react-hook-form&quot;;
  
  export default function App() {
    const { register, handleSubmit, watch, errors } = useForm();
    const onSubmit = data =&gt; console.log(data);
  
    console.log(watch(&quot;example&quot;)); // watch input value by passing the name of it
  
    return (
      {/* &quot;handleSubmit&quot; will validate your inputs before invoking &quot;onSubmit&quot; */}
      &lt;form onSubmit={handleSubmit(onSubmit)}&gt;
      {/* register your input into the hook by invoking the &quot;register&quot; function */}
        &lt;input name=&quot;example&quot; defaultValue=&quot;test&quot; ref={register} /&gt;
        
        {/* include validation with required or other standard HTML validation rules */}
        &lt;input name=&quot;exampleRequired&quot; ref={register({ required: true })} /&gt;
        {/* errors will return when field validation fails  */}
        {errors.exampleRequired &amp;&amp; &lt;span&gt;This field is required&lt;/span&gt;}
        
        &lt;input type=&quot;submit&quot; /&gt;
      &lt;/form&gt;
    );
  }
  </code></pre>