title: Argument of type '{...}' is not assignable to parameter of type 'Context<AuthProps>'
body: <p>I'm creating a login and signup interface with Firebase, in my Ionic(React) app project, below are the snippet of my code.</p>
  <pre><code>interface LoginProps extends RouteComponentProps&lt;any&gt; {}
  interface AuthProps {}
  
  const Login: FC&lt;LoginProps&gt; = ({ history }) =&gt; {
    const handleLogin = useCallback(
      async event =&gt; {
        event.preventDefault();
        const { email, password } = event.target.elements;
        try {
          await Firebase
            .auth()
            .signInWithEmailAndPassword(email.value, password.value);
          history.push(&quot;/dashboard&quot;);
        } catch (error) {
          alert(error);
        }
      },
      [history]
    );
  
    const { currentUser } = useContext&lt;AuthProps&gt;(AuthContext);
  
    if (currentUser) {
      return &lt;Redirect to=&quot;/&quot; /&gt;;
    }
  </code></pre>
  <p>I got this error messages:</p>
  <blockquote>
  <p>[react-scripts] TypeScript error in /Users/matheuslira/Desktop/brasilsul-repasse/src/pages/Login.tsx(43,49):</p>
  <p>[react-scripts] Argument of type '{ AuthContext: React.Context; AuthProvider: ({ children }: { children: any; }) =&gt; JSX.Element; }' is not assignable to parameter of type 'Context'.</p>
  <p>[react-scripts]   Type '{ AuthContext: Context; AuthProvider: ({ children }: { children: any; }) =&gt; Element; }' is missing the following properties from type 'Context': Provider, Consumer  TS2345</p>
  </blockquote>
  <p>the error message point to this part of the code:</p>
  <blockquote>
  <p>const { currentUser } = useContext(AuthContext);</p>
  </blockquote>
  <p>I don't know how to fix this error.</p>
  <p>// Edit</p>
  <p>AuthContext Code</p>
  <pre><code>import React, { useEffect, useState, createContext } from &quot;react&quot;
  import Firebase from &quot;./firebase&quot;
  
  export const AuthContext = createContext(null)
  export const AuthProvider = ({ children }) =&gt; {
      const [currentUser, setCurrentUser] = useState(null)
  
      useEffect(() =&gt; {
          Firebase.auth().onAuthStateChanged(setCurrentUser)
      }, [])
  
      return (&lt;AuthContext.Provider value = {{currentUser}} &gt;{children}&lt;/AuthContext.Provider&gt;)
  }
  
  export default {
      AuthContext,
      AuthProvider
  }
  </code></pre>