"TypeError:Object(...)不是函数"; react-redux-firebase [英] "TypeError: Object(...) is not a function" react-redux-firebase
问题描述
我正在尝试在React中创建一个项目,并且正在使用Firebase.在我的react-redux-firebase项目中,有一行代码出错,但是我无法解决.我如何解决此"TypeError:Object(...)不是函数"
I'm trying to create a project in React and I'm using Firebase. In my react-redux-firebase project one line of code making error but I couldn't fix that. How could I fix this "TypeError: Object(...) is not a function"
我已经搜索了此问题,但无法解决该问题.
I have searched for this problem but couldn't fix the problem.
我正在关注一个React版本为16.4.1的教程.我不确定这是否是问题
I'm following a tutorial where the react version is 16.4.1. I'm not sure this is the problem or not
import React from "react";
import ReactDOM from "react-dom";
import "./index.css";
import App from "./App";
import * as serviceWorker from "./serviceWorker";
import { createStore, applyMiddleware, compose } from "redux";
import rootReducer from "./store/reducers/rootReducer";
import { Provider } from "react-redux";
import thunk from "redux-thunk";
import { reduxFirestore, getFirestore } from "redux-firestore";
import { reactReduxFirebase, getFirebase } from "react-redux-firebase";
import fbConfig from "./config/fbConfig";
const store = createStore(
rootReducer,
compose(
applyMiddleware(thunk.withExtraArgument({ getFirebase, getFirestore })),
reduxFirestore(fbConfig),
reactReduxFirebase(fbConfig)
)
);
如果我注释掉reatReduxFirebase(),那么它可以正常工作,但是我需要它工作
if I comment out the reatReduxFirebase() then it works fine but I need this to work
您可以在此处找到所有代码: https://github.com/martuza-shimul /React-Blog-app
You could find all codes here: https://github.com/martuza-shimul/React-Blog-app
我每次都会收到此错误:
TypeError: Object(...) is not a function
Module../src/index.js
i:/Learning new things/react/pma/src/index.js:17
14 | const store = createStore(
15 | rootReducer,
16 | compose(
> 17 | applyMiddleware(thunk.withExtraArgument({ getFirebase, getFirestore })),
18 | reduxFirestore(fbConfig),
19 | reactReduxFirebase(fbConfig)
20 |
我不确定如何解决此问题.真的很感谢您的帮助/提示.
I'm not sure how to fix this. A little bit of help/hint really be appreciated.
推荐答案
请使用此npm软件包
npm软件包兼容性问题
Please use this npm packages
npm packages compatibility issue
npm i-保存react-redux@5.1.1 react-redux-firebase@2.2.4
npm i --save react-redux@5.1.1 react-redux-firebase@2.2.4
这篇关于"TypeError:Object(...)不是函数"; react-redux-firebase的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!