Closed
Description
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
Labels
No labels