0

I'm trying to connect firebase, but I get such an error:

TypeError: Object(...) is not a function

enter image description here My store.js

import { compose, createStore, applyMiddleware } from 'redux';
import thunk from 'redux-thunk';
import { reactReduxFirebase, getFirebase } from 'react-redux-firebase';
import { reduxFirestore, getFirestore } from 'redux-firestore';

// Importing components
import rootReducer from './reducers/rootReducer';
import firebase from '../fbconfig/fbConfig';

const rrfConfig = {
  userProfile: 'users',
  useFirestoreForProfile: true 
};

const composeEnhancers =
  process.env.NODE_ENV === 'development'
    ? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose
    : compose;

const store = createStore(
  rootReducer,
  composeEnhancers(
    reactReduxFirebase(firebase, rrfConfig),
    reduxFirestore(firebase),
    applyMiddleware(thunk.withExtraArgument({ getFirebase, getFirestore }))
  )
);

export default store;

My firebase conf

import firebase from 'firebase/app';
import 'firebase/firestore';
import 'firebase/auth';
import 'firebase/storage';

const config = {
    apiKey: "",
    authDomain: "",
    databaseURL: "",
    projectId: "",
    storageBucket: "",
    messagingSenderId: "",
    appId: ""
};

firebase.initializeApp(config);
firebase.firestore();

export default firebase;

Just trying to connect firebase to redux How to fix this problem?

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
luckydev
  • 155
  • 10
  • 4
    Please don't just dump your code and error message. Please also explain what you have already tried, and ideally show the smallest code necessary to reproduce the error. – Christian Fritz Jan 18 '20 at 03:06
  • ^ agreed, have you googled your error message and context? There's a bunch of answers around them already, did you try any of them? If so let us know which ones – Jayce444 Jan 18 '20 at 03:35
  • Does this answer your question? [Cannot call reactReduxFirebase() - TypeError: Object is not a function](https://stackoverflow.com/questions/66536513/cannot-call-reactreduxfirebase-typeerror-object-is-not-a-function) – Linda Paiste Mar 08 '21 at 22:20

0 Answers0