Skip to content

Fix 2.0 beta documentation error for getting started #350

Closed
@omoki

Description

@omoki

According to the migration guide, the reactReduxFirebase function no longer takes firebaseConfig as an argument. Rather, firebase object that is already initialized should be passed in.

The error in documentation is found in getting started guide under Compose Function

The following seems to be the correct way:

Compose Function

import { compose } from 'redux'
import { reactReduxFirebase } from 'react-redux-firebase'
import firebase from 'firebase';

// Firebase config
const firebaseConfig = {
  apiKey: '<your-api-key>',
  authDomain: '<your-auth-domain>',
  databaseURL: '<your-database-url>',
  storageBucket: '<your-storage-bucket>'
}

firebase.initializeApp(firebaseConfig); //------------> ADDED

// react-redux-firebase options
const config = {
  userProfile: 'users', // firebase root where user profiles are stored
  enableLogging: false, // enable/disable Firebase's database logging
}

// Add redux Firebase to compose
const createStoreWithFirebase = compose(
  reactReduxFirebase(firebase, config) //--------------> SUGGESTED FIX
)(createStore)

// Create store with reducers and initial state
const store = createStoreWithFirebase(rootReducer, initialState)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions