Я попробовал решение applyMiddleware (thunk.withExtraArgument ({getFirebase, getFirestore})), выполнив npm i --save response-redux-firebase @ next, но оно не сработало.
Можете ли вы помочь мне?
index. js
/* eslint-disable no-unused-vars */
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import firebase from 'firebase'
import {createStore, applyMiddleware,compose,} from 'redux';
import rootReducer from './store/rootReducer';
import {Provider} from 'react-redux'
import thunk from 'redux-thunk'
import {getFirestore,reduxFirestore } from 'redux-firestore'
import {getFirebase,reactReduxFirebase} from 'react-redux-firebase'
import fbConfig from './config/fbConfig'
import { firestore } from 'firebase';
import { render } from 'react-dom'
const store=createStore(rootReducer,
compose(
applyMiddleware(thunk.withExtraArgument({getFirebase,getFirestore})),
reduxFirestore(fbConfig,firebase),
reactReduxFirebase(fbConfig, firebase, {useFirestoreForProfile:true,
userProfile:'users',
attachAuthIsReady: true})
)
);
store.firebaseAuthIsready.then(()=>{
ReactDOM.render(<Provider store ={store}></Provider>><App />, document.getElementById('root'));
})
rootreducer. js
import authReducer from '../store/actions/authReducer';
import projectReducer from './projectReducer';
import {combineReducers} from 'redux';
import {firestoreReducer} from 'redux-firestore';
import {firebaseReducer} from 'react-redux-firebase';
const rootReducer=combineReducers({
auth:authReducer,
project:projectReducer,
firestore:firestoreReducer,
firebase:firebaseReducer
})
export default rootReducer