我一直在使用 react-redux-firebase 开展一个项目,该项目以前对我有用。今天我收到以下错误:
我不确定错误是否在我的代码中的其他地方,或者我是否必须将 react-redux-firebase 更新到版本 3 。,目前似乎不存在。其他人遇到过这个问题吗?我会很感激任何建议。
这是我的 package.json 中的依赖项:
"dependencies": {
"firebase": "^5.7.0",
"react": "^16.6.3",
"react-dom": "^16.6.3",
"react-redux": "^6.0.0",
"react-redux-firebase": "^2.2.5",
"react-router-dom": "^4.3.1",
"react-scripts": "2.1.1",
"redux": "^4.0.1",
"redux-firestore": "^0.6.0",
"redux-thunk": "^2.3.0"
},
这是我的 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/index';
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 './firebase/fbConfig';
const store = createStore(
rootReducer,
compose(
applyMiddleware(
thunk.withExtraArgument({
getFirebase,
getFirestore
})),
reduxFirestore(fbConfig),
reactReduxFirebase(fbConfig)
)
);
ReactDOM.render(<Provider store={store}><App /></Provider>, document.getElementById('root'));
serviceWorker.unregister();