I've been working on a project using react-redux-firebase, which has worked for me before. today I got the following error:
I'm not sure if the error is somewhere else in my code or if I have to update react-redux-firebase to version 3.., which doesn't seem to exist as of now. Has anyone else had this issue? I'd be grateful for any suggestions.
Here are the dependencies in my 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"
},
This is what my index.js file looks like:
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();
1- Download v3 as following:
npm i --save react-redux-firebase@latest
Then you can refactor your code to work with v3 as written here in the docs: https://github.com/prescottprue/react-redux-firebase/tree/next
2- Or just use react-redux v5.1.1
npm i --save react-redux@^5.0.0