title: React Typescript - Argument of type is not assignable to parameter of type
body: <p>I have a demo <a href="https://stackblitz.com/edit/react-ts-xoktyd?file=Form.tsx" rel="noreferrer">here</a></p>
  
  <p>It's a React app using Typescript and hooks to capture entries into form that are simple displayed below.</p>
  
  <p>Here in Stackblitz it works but locally I am using VS code and I get an error for <code>setUser(userData);</code> the error is</p>
  
  <pre><code>const userData: {
      username: string;
      password: string;
      prevState: null;
  }
  Argument of type '{ username: string; password: string; prevState: null; }' is not assignable to parameter of type '(prevState: null) =&gt; null'.
    Type '{ username: string; password: string; prevState: null; }' provides no match for the signature '(prevState: null): null'.ts(2345)
  </code></pre>
  
  <p>How can I fox this typescript error</p>