diff options
Diffstat (limited to 'packages/website/ts/lazy_component.tsx')
-rw-r--r-- | packages/website/ts/lazy_component.tsx | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/packages/website/ts/lazy_component.tsx b/packages/website/ts/lazy_component.tsx index 359a1fe65..48800c2dd 100644 --- a/packages/website/ts/lazy_component.tsx +++ b/packages/website/ts/lazy_component.tsx @@ -23,20 +23,20 @@ export class LazyComponent extends React.Component<LazyComponentProps, LazyCompo } public componentWillMount() { // tslint:disable-next-line:no-floating-promises - this.loadComponentFireAndForgetAsync(this.props); + this._loadComponentFireAndForgetAsync(this.props); } public componentWillReceiveProps(nextProps: LazyComponentProps) { if (nextProps.reactComponentPromise !== this.props.reactComponentPromise) { // tslint:disable-next-line:no-floating-promises - this.loadComponentFireAndForgetAsync(nextProps); + this._loadComponentFireAndForgetAsync(nextProps); } } public render() { - return _.isUndefined(this.state.component) ? - null : - React.createElement(this.state.component, this.props.reactComponentProps); + return _.isUndefined(this.state.component) + ? null + : React.createElement(this.state.component, this.props.reactComponentProps); } - private async loadComponentFireAndForgetAsync(props: LazyComponentProps) { + private async _loadComponentFireAndForgetAsync(props: LazyComponentProps) { const component = await props.reactComponentPromise; this.setState({ component, @@ -61,11 +61,6 @@ export const createLazyComponent = (componentName: string, lazyImport: () => Pro } return component; })(); - return ( - <LazyComponent - reactComponentPromise={reactComponentPromise} - reactComponentProps={props} - /> - ); + return <LazyComponent reactComponentPromise={reactComponentPromise} reactComponentProps={props} />; }; }; |