hongbo-miao/hongbomiao.com

View on GitHub
web/src/shared/components/LazyComponent.tsx

Summary

Maintainability
A
0 mins
Test Coverage
import React, { ReactNode, Suspense } from 'react';
import HmLoading from './Loading';

type Props = {
  children: ReactNode;
};

function LazyComponent(props: Props) {
  const { children } = props;
  return <Suspense fallback={<HmLoading />}>{children}</Suspense>;
}

export default LazyComponent;