title: Getting TS Error: Property 'user' does not exist on type 'IAuth | null'
body: <p>I am using context for Auth in my simple typescript app.
  My context declaration is in the file
  <code>AuthProvider.tsx</code>, which looks like:</p>
  <pre><code>import React, { createContext, useState } from 'react';
  import auth from '@react-native-firebase/auth';
  
  export interface IAuth {
      user,
      setUser,
      login,
      register,
      logout
  }
  
  export const AuthContext = createContext&lt;IAuth | null&gt;(null);
  
  export const AuthProvider = ({ children }) =&gt; {
      const [user, setUser] = useState(null);
  
      return (
          &lt;AuthContext.Provider
              value={{
                  user: user,
                  setUser: setUser,
                  login: async (email, password) =&gt; {
                      try {
                          await auth().signInWithEmailAndPassword(email, password);
                      } catch (e) {
                          console.log(e);
                      }
                  },
                  register: async (email, password) =&gt; {
                      try {
                          await auth().createUserWithEmailAndPassword(email, password);
                      } catch (e) {
                          console.log(e);
                      }
                  },
                  logout: async () =&gt; {
                      try {
                          await auth().signOut();
                      } catch (e) {
                          console.log(e);
                      }
                  },
              }}&gt;
              {children}
          &lt;/AuthContext.Provider&gt;
      );
  };
  
  </code></pre>
  <p>This is how I am using it elsewhere:</p>
  <pre><code>  const { user, setUser } = useContext(AuthContext);
  </code></pre>
  <p>But Typescript throws 2 errors on this lien:</p>
  <ol>
  <li>Property 'user' does not exist on type 'IAuth | null'</li>
  <li>Property 'setUser' does not exist on type 'IAuth | null'</li>
  </ol>
  <p>What can I do to bypass it?</p>