I am getting this error "TypeError: Cannot read property 'subscribe' of undefined".
I looked in StackOverflow and find many questions like this one, but none of them provide a solution that solves this issue. I hope if someone tells me what wrong with it.
index.js
import React from 'react';
import ReactDOM from 'react-dom';
import * as serviceWorker from './serviceWorker';
import { Provider } from 'react-redux';
import {PersistGate} from 'redux-persist/integration/react';
import App from './App';
import {store} from './Components/redux/store.js'
import {persistore} from './Components/redux/store.js'
import 'bootstrap/dist/css/bootstrap.min.css';
import './index.css';
import './Components/fonsts/AnonymousPro-Bold.ttf'
ReactDOM.render(
<React.StrictMode>
<Provider store={store}>
<PersistGate persistore={persistore}>
<App />
</PersistGate>
</Provider>
</React.StrictMode>,
document.getElementById('root')
);
store.js
import { createStore, combineReducers, applyMiddleware } from 'redux';
import thunkMiddleWare from 'redux-thunk';
import { composeWithDevTools } from 'redux-devtools-extension';
import { searchItemsReducer, requestSearchItemsReducer, requestUserLoginReducer } from './Reducers.js';
import { persistStore, persistReducer } from 'redux-persist';
import storage from 'redux-persist/lib/storage';
const persistConfig = {
key: 'root',
storage: storage,
whitelist: ['requestUserLoginReducer']
};
const rootReducers = combineReducers({
searchItemsReducer,
requestSearchItemsReducer,
requestUserLoginReducer
});
const middleware = composeWithDevTools(applyMiddleware(thunkMiddleWare));
const pReducer = persistReducer(persistConfig, rootReducers);
export const store = createStore(pReducer, middleware);
export const persistore = persistStore(store);
I initialize the state in the reducer.js
Thank you
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…