@react-firebase/hooks
v0.1.2
Published
React Custom Hooks for interacting with Firebase
Downloads
39
Readme
React hooks for interacting with your Firebase database
React Firebase Hooks for React & React Native
Install
yarn add @react-firebase/hooks
Usage
import { FirebaseProvider, useDatabase } from "@react-firebase/hooks";
function UserBookmarks() {
const { isLoading, value, ref } = useDatabase({
path: "user_bookmarks/",
limitToFirst: 2
});
return <pre>{JSON.stringify({ isLoading, value }, null, 2)}</pre>;
}
function App() {
return (
<FirebaseProvider firebase={firebase} {...config}>
<UserBookmarks />
</FirebaseProvider>
);
}