TypeError: Object(…) is not a function in react-redux-firebase package
Dung Do Tien
Jan 23 2021
522
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.
-
L-1
Le Ba Tuan Anh Jan 23 2021
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:
npm install react-redux@5.1.1 react-redux-firebase@2.2.4
I hope it works for you.
* Type maximum 2000 characters.
* All comments have to wait approved before display.
* Please polite comment and respect questions and answers of others.