echoes/frontend/components/LoadingBoundary.tsx
lsy 7e4d9c1b48 增加readme,删除了注释
前端:完善了插件和主题的契约
2024-11-19 00:20:31 +08:00

18 lines
348 B
TypeScript

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>
);
};