我正在尝试在 React 中创建一个项目,并且我正在使用 Firebase。在我的 react-redux-firebase 项目中,一行代码出错,但我无法解决。我该如何解决这个“TypeError: Object(...) is not a function”
我已经搜索过这个问题,但无法解决问题。
我正在关注反应版本为 16.4.1 的教程。我不确定这是不是问题
index.js 文件
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() 那么它工作正常但我需要这个工作
你可以在这里找到所有代码: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 |
我不知道如何解决这个问题。一点帮助/提示真的很感激。