Table of Contents


React hook that provides firebase object. Firebase is gathered from ReactReduxFirebaseContext, which is set by createFirebaseInstance during setup. NOTE: This version of the Firebase library has extra methods, config, and functionality which give it it's capabilities such as dispatching actions.



import { useFirebase } from 'react-redux-firebase'

export default function AddData() {
  const firebase = useFirebase()

  function addTodo() {
    const exampleTodo = { done: false, text: 'Sample' }
    return firebase.push('todos', exampleTodo)

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

Returns object Extended Firebase instance

results matching ""

    No results matching ""