TypeError: Object(…) is not a function in react-redux-firebase package

Dung Do Tien Jan 23 2021 97

I am creating a project with ReactJs, I import and use Firebase but I got an error: TypeError: Object(…) is not a function.

Here is my index.js file:

 import React from "react";
import ReactDOM from "react-dom";
import "./index.css";
import * as serviceWorker from "./serviceWorker";
import { createStore, applyMiddleware, compose } from "redux";
import rootReducer from "./store/reducers/rootReducer";
import thunk from "redux-thunk";
import { reduxFirestore, getFirestore } from "redux-firestore";
import { reactReduxFirebase, getFirebase } from "react-redux-firebase";
import dbConfig from "./config/dbConfig";

const store = createStore(
  rootReducer,
  compose(
    applyMiddleware(thunk.withExtraArgument({ getFirebase, getFirestore })),
    reduxFirestore(dbConfig),
    reactReduxFirebase(dbConfig)
  )
);

My react version:

 "react": "^16.4.1",

Thanks for any suggestion.

Have 1 answer(s) found.
  • This is a problem related to npm packages compatibility issue. You need to adjust npm package versions for react-redux & react-redux-firebase

    Run the command below to update the correct version for them:

    I hope it works for you.

    Le Ba Tuan Anh Jan 23 2021
Leave An Answer
* NOTE: You need Login before leave an answer

* Type maximum 2000 characters.

* All comments have to wait approved before display.

* Please polite comment and respect questions and answers of others.

Popular Tips

X Close