Table of Contents


React hook that return firestore object. Firestore instance is gathered from store.firestore, which is attached to store by the store enhancer (reduxFirestore) during setup of redux-firestore



import React from 'react'
import { useFirestore } from 'react-redux-firebase'

export default function AddData({ firebase: { add } }) {
  const firestore = useFirestore()

  function addTodo() {
    const exampleTodo = { done: false, text: 'Sample' }
    return firestore.collection('todos').add(exampleTodo)

  return (
      <button onClick={addTodo}>
        Add Sample Todo

Returns object Extended Firestore instance

results matching ""

    No results matching ""