import React from 'react';
const MyFunctionalComponent: React.FC = () => {
const MyLazyComponent = React.lazy(() => import('./MyLazyComponent')); //引入组件
return (
<div>
{/* 函数组件的其他内容 */}
<React.Suspense fallback={<div>Loading...</div>}> //设置未加载时UI
<MyLazyComponent />
</React.Suspense>
</div>
);
};
export default MyFunctionalComponent;