title: Type not assignable (React + Typescript + Firebase)
body: <p>I'm pretty new at typescript and migrating my react app to using ts.</p>
  
  <p>I'm using the firebase auth service and I'm facing some type issues which I can't seem to get around. Please advise!</p>
  
  <pre><code>import React, { useEffect, useState } from 'react';
  import app from './firebase';
  
  export const AuthContext = React.createContext(null);
  
  export const AuthProvider: React.FC&lt;Props&gt; = ({ children }) =&gt; {
    const [currentUser, setCurrentUser] = useState(null);
    const [pending, setPending] = useState(true);
  
    useEffect(() =&gt; {
      app.auth().onAuthStateChanged((user) =&gt; {
        // ts error here
        setCurrentUser(user);
        setPending(false);
      });
    }, []);
  
    if(pending){
      return &lt;&gt;Loading...&lt;/&gt;;
    }
  
    return (
      &lt;AuthContext.Provider
        // ts error here
        value={{ currentUser }}
      &gt;
        {children}
      &lt;/AuthContext.Provider&gt;
    );
  };
  
  interface Props {
    children: React.ReactNode;
  }
  </code></pre>
  
  <p><code>setCurrentUser(user);</code> is giving me an error of 
  <code>Argument of type 'User | null' is not assignable to parameter of type 'SetStateAction&lt;null&gt;'.</code></p>
  
  <p>and</p>
  
  <p><code>value={{ currentUser }}</code> is giving me an error of <code>Type '{ currentUser: null; }' is not assignable to type 'null'.</code></p>