pswui/packages/react/lib/withSSD.tsx
2024-07-12 01:25:10 +09:00

17 lines
394 B
TypeScript

import type { ComponentType } from "react";
import { ServerSideDocumentFallback } from "./ssrFallback";
function withServerSideDocument<P extends {}>(
Component: ComponentType<P>,
): ComponentType<P> {
return (props) => {
return (
<ServerSideDocumentFallback>
<Component {...props} />
</ServerSideDocumentFallback>
);
};
}
export { withServerSideDocument };