react-firebase-auth-hook
Version:
its a auth hook of firebase,can be use with react as a useFirebase custom hook.
20 lines (16 loc) • 552 B
JSX
import { getAuth } from 'firebase/auth';
import { initializeApp } from "firebase/app";
import FirebaseContext from './FirebaseContext';
import authentications from './authentications';
// auth Provider
const FirebaseProvider = ({ config, children }) => {
// ** need to verify config here ** //
const auth = getAuth(initializeApp(config));
const all = authentications(auth);
return (
<FirebaseContext.Provider value={all}>
{children}
</FirebaseContext.Provider>
);
};
export default FirebaseProvider;