Я получаю белые вспышки и белый экран смерти после второго запуска приложения после добавления redux-persist
.Версия «redux-persist» - «^ 5.10.0».
Вот мой App.js
файл:
import { PersistGate } from 'redux-persist/integration/react'
import {store, persistor } from './redux/store'
export default class App extends React.Component {
renderLoading = ()=> {
<View>
<ActivityIndicator size="large"/>
</View>
}
render() {
return(
<Provider store={store}>
<PersistGate loading={this.renderLoading()} persistor={persistor}>
<AppContainer/>
</PersistGate>
</Provider>
)
}
}
Вот мой ./redux/store файл:
import { createStore, applyMiddleware } from 'redux'
import { AsyncStorage } from 'react-native'
import thunkMiddleware from 'redux-thunk'
import { persistStore, persistReducer } from "redux-persist"
import reducers from './index';
import bindAuthEvents from '../auth/redux/bindEvents';
import bindTrackingEvents from '../tracking/redux/bindEvents';
const persistConfig = {
key: 'root',
storage: AsyncStorage,
}
const persistedReducer = persistReducer(persistConfig, reducers)
const createStoreWithMiddleware = applyMiddleware(thunkMiddleware)(createStore);
export const store = createStoreWithMiddleware(persistedReducer);
const dispatch = event => store.dispatch(event)
const getState = () => store.getState()
bindAuthEvents(dispatch, getState);
bindTrackingEvents(dispatch, getState);
export const persistor = persistStore(store);
В чем может быть проблема?и как можно это исправить?