0.1.2 • Published 6 years ago

@react-firebase/hooks v0.1.2

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

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>
  );
}