Skip to content

Instantly share code, notes, and snippets.

@sagiavinash
Last active August 10, 2018 15:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sagiavinash/41602770dc99ba5a6488cbece8bd55a7 to your computer and use it in GitHub Desktop.
Save sagiavinash/41602770dc99ba5a6488cbece8bd55a7 to your computer and use it in GitHub Desktop.
// AppContainer.js
import {withRefreshedStore} from 'react-store-manager';
const HomeRoute = Loadable({
loader: withRefreshedStore(import('./HomePageContainer')),
loading: () => <div>Loading...</div>
});
const ProductListRoute = Loadable({
loader: withRefreshedStore(import('./ProductListPageContainer')),
loading: () => <div>Loading...</div>
});
function AppContainer({login}) {
return (
<App login={login}>
<Switch>
<Route exact path="/" component={HomeRoute} />
<Route exact path="/products" component={ProductListRoute} />
</Switch>
</App>
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment