Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import * as React from 'react';
- import * as Loadable from 'react-loadable';
- import OptionsWithRender = LoadableExport.OptionsWithRender;
- import AsyncLoader from '../components/AsyncLoader';
- import {IProps} from './AddBeer';
- const loadableOptions: OptionsWithRender<IProps, any> = {
- loader: () => import(/* webpackChunkName: "AddBeer" */ './AddBeer'),
- loading: AsyncLoader,
- render(loaded: any, props: IProps) {
- const Component: any = loaded.default; // tslint:disable-line:variable-name
- return <Component {...props} />;
- },
- };
- export default Loadable(loadableOptions);
- /*
- <AddBeerAsync
- data={'stuff'}
- />
- */
Add Comment
Please, Sign In to add comment