0.6.2 • Published 2 years ago
@cnazha/firebase-user-hook v0.6.2
@cnazha/firebase-user-hook
Handle auth listener with user load from firestore
Installation
npm install @cnazha/firebase-user-hook
Usage
import { useFirebaseAuth } from '@cnazha/firebase-user-hook';
const { user, loading, error } = useFirebaseAuth();
Example
const { user, loading, error } = useFirebaseAuth();
if (loading || error) {
return <ActivityIndicator />;
}
return (
<View style={styles.container}>
<Text>{user ? 'Logged in' : 'Logged out'}</Text>
</View>
);
Contributing
See the contributing guide to learn how to contribute to the repository and the development workflow.
License
MIT
Made with create-react-native-library