Open toringo opened 5 years ago
My store is being hydrated twice. store.js :
const config = { key: 'root', storage: AsyncStorage, whitelist: ['account', 'session', 'task', 'inspiration'], blacklist: [], timeout: null, }; if (__DEV__) { const xhr = global.originalXMLHttpRequest ? global.originalXMLHttpRequest : global.XMLHttpRequest; global.XMLHttpRequest = xhr; } const reducers = persistReducer(config, rootReducer); const enhancers = [applyMiddleware(...middleware)]; const initialState = { }; const persistConfig = { enhancers }; const store = createStore(reducers, initialState, compose(...enhancers)); const persistor = persistStore(store, persistConfig, () => { // console.log('Test', store.getState()); });
StoreProvider.js :
render() { return ( <Provider store={store}> <PersistGate loading={<ActivityIndicator style={styles.loading} />} persistor={persistor}> {this.props.children} </PersistGate> </Provider>); }
The problem is similar to #909 . Any idea? Excuse me @rt2zz @Andarist
can anyone provide a solution this, I am experiencing the same issue as well.
My store is being hydrated twice. store.js :
StoreProvider.js :
Result
The problem is similar to #909 . Any idea? Excuse me @rt2zz @Andarist