text: import React, { useEffect, useState } from "react";
  import config from "./config";
  
  export const AuthContext = React.createContext();
  
  export const AuthProvider = ({ children }) => {
    const [currentUser, setCurrentUser] = useState(null);
  
    useEffect(() => {
      config.auth().onAuthStateChanged(setCurrentUser);
    }, []);
  
    return (
      <AuthContext.Provider
        value={{
          currentUser
        }}
      >
        {children}
      </AuthContext.Provider>
    );
  };