TypeError: Object(…) is not a function on index.js

后端 未结 1 1106
执念已碎
执念已碎 2021-01-01 06:42

Hi i get this error when in my browser when i run my code:

TypeError: Object(...) is not a function ./src/index.js src/index.js:31

28 | firebaseStateName

1条回答
  •  臣服心动
    2021-01-01 07:13

    This is where your problem is:

        reactReduxFirebase(firebase, config),
        reduxFirestore(firebase)
    

    There has been a little change in the configuration in the latest version, which you must use if you're using react V6.

    *Make sure you install the latest version by typing:

    npm i --save react-redux-firebase@next
    

    http://docs.react-redux-firebase.com/history/v3.0.0/docs/v3-migration-guide.html

    + import { ReactReduxFirebaseProvider } from 'react-redux-firebase'
    + import { createFirestoreInstance } from 'redux-firestore'
    - import { reactReduxFirebase } from 'react-redux-firebase' // removed
    - import { reduxFirestore } from 'redux-firestore'          // removed
    
    const store = createStore(
      rootReducer,
      initialState,
      compose(
    -    reactReduxFirebase(firebase, rrfConfig), // removed
    -    reduxFirestore(firebase)
        //  applyMiddleware(...middleware)       // removed
      )
    )
    
    + const rrfProps = {
    +   firebase,
    +   config: rrfConfig,
    +   dispatch: store.dispatch,
    +   createFirestoreInstance // <- needed if using firestore
    + }
    const App = () => (
      
    +   
          
    +   
      
    );
    

    0 讨论(0)
提交回复
热议问题