in client/components/mma/shared/AsyncLoader.tsx [65:93]
public render(): React.ReactNode {
if (this.state.loadingState === LoadingState.Loading) {
return this.props.inline ? (
<Spinner
loadingMessage={this.props.loadingMessage}
inline={this.props.inline}
scale={this.props.spinnerScale}
/>
) : (
<WithStandardTopMargin>
<Spinner loadingMessage={this.props.loadingMessage} />
</WithStandardTopMargin>
);
} else if (
this.state.loadingState === LoadingState.Loaded &&
this.state.data !== undefined
) {
return this.props.render(this.state.data, () =>
this.setState(
{ loadingState: LoadingState.Loading },
// eslint-disable-next-line -- supress @typescript-eslint/unbound-method on this line
this.componentDidMount,
),
);
} else if (this.props.errorRender) {
return this.props.errorRender();
}
return <GenericErrorScreen />;
}