import * as React from 'react';
import AuthStack from './Stack' // <-- made in step #2 😇
import { DoormanProvider, AuthGate } from 'react-native-doorman'
import { createAppContainer } from 'react-navigation'
import firebase from 'firebase/app'
firebase.initializeApp(YOUR_FIREBASE_CONFIG)
// create react navigation container
const Navigator = createAppContainer(AuthStack)
// create our App component, shown once we've authed
// you can replace this with your App it exists
const AuthedApp = () => (
onPress={() => firebase.auth().signOut()}
style={{ paddingTop: 300, color: 'blue', fontSize: 24 }}
<DoormanProvider publicProjectId="YOUR-PROJECT-ID">
{({ user, loading }) => {
if (loading) return <></>
// if a user is authenticated
if (user) return <AuthedApp />
// otherwise, send them to the auth flow