echoes/frontend/components/LoadingBoundary.tsx
lsy 5ca72e42cf 前端:创建api,主题,路由服务,重新定义主题插件的约束,错误,加载组件
后端:去除文章和模板的自义定路径,创建获取系统令牌api
2024-11-18 01:09:28 +08:00

19 lines
393 B
TypeScript

// File path: components/LoadingBoundary.tsx
import React, { Suspense } from 'react';
interface LoadingBoundaryProps {
children: React.ReactNode;
fallback?: React.ReactNode;
}
export const LoadingBoundary: React.FC<LoadingBoundaryProps> = ({
children,
fallback = <div>Loading...</div>
}) => {
return (
<Suspense fallback={fallback}>
{children}
</Suspense>
);
};