Search code examples
reactjsfirebasereduxreact-reduxredux-firestore

× TypeError: Object(...) is not a function, while creating store using redux and firebase


These are the versions I am using :

 "redux": "^4.0.5",
 "react-redux": "^7.2.0",
 "redux-firestore": "^0.13.0"
 "firebase": "^7.14.3",
 "redux": "^4.0.5",
 "react-redux-firebase": "^3.4.0",

I am getting this error while creating the store :

  const store = createStore(
  rootReducer,
  initialState,
  compose(
    reactReduxFirebase(firebase),
    window.__REDUX__DEVTOOLS_EXTENSION__ &&
      window.__REDUX__DEVTOOLS_EXTENSION__()
  )
);

Solution

  • can you try this?

    import { applyMiddleware, compose, createStore } from 'redux'
    import { reducers } from 'redux/reducers'
    
    const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose
    
    export const store = createStore(reducers, composeEnhancers(applyMiddleware()))
    

    you don't want to compose the redux dev tools. you should be doing one or the other