Open alainib opened 6 years ago
this is my actual code :
store.js
import { createStore, compose, applyMiddleware } from 'redux'; import { persistStore, persistCombineReducers } from 'redux-persist'; import storage from 'redux-persist/lib/storage'; import { createLogger } from 'redux-logger'; import rootReducers from "test/src/redux/reducers"; const config = { key: 'root', storage, }; const middleware = []; const reducers = persistCombineReducers(config, rootReducers); const enhancers = [applyMiddleware(...middleware)]; const initialState = {}; const persistConfig = { enhancers }; const store = createStore(reducers, undefined, compose(...enhancers)); const persistor = persistStore(store, persistConfig, () => {}); const configureStore = () => { return { persistor, store }; } export default configureStore;
App.js
import configureStore from "test/src/redux/store"; const { persistor, store } = configureStore(); const MyTabView = TabNavigator({ ... }); export default class App extends React.PureComponent { ... render() { return ( <Provider store={store}> <PersistGate loading={<ActivityIndicator />} persistor={persistor}> <MyTabView /> </PersistGate> </Provider> ); } }
how to integrate your lib with Provider and PersistGate instead of AppNavigator
Version: npm version or "master"
Steps to reproduce
this is my actual code :
store.js
App.js
Expected behaviour
how to integrate your lib with Provider and PersistGate instead of AppNavigator
Environment
react-navigation-is-focused-hoc
Version: npm version or "master"