firebase for React Native
import { firebase } from "@firebase/app";
//import modules
import "@firebase/auth";
const firebaseConfig = {
apiKey: "",
authDomain: "",
projectId: "",
storageBucket: "",
messagingSenderId: "",
appId: "",
};
//Delete that after realisation of authContext !!
if (!firebase.apps.length) {
firebase.initializeApp(firebaseConfig);
}
//Auth with email and password
//Put into export App
const [isAuthenticated, setIsAuthenticated] = useState(false);
useEffect(() => {
firebase
.auth()
.signInWithEmailAndPassword("[email protected]", "password")
.then((user) => {
console.log(user);
setIsAuthenticated(true);
})
.catch((e) => {
console.log(e);
});
}, []);