fix: resolve runtime error

This commit is contained in:
GitPusher99
2024-03-30 00:11:23 +08:00
parent b3ee1c1df4
commit 7f760b4dd3
2 changed files with 30 additions and 2 deletions
+4 -2
View File
@@ -1,13 +1,15 @@
'use client';
import SwaggerUI from 'swagger-ui-react';
import 'swagger-ui-react/swagger-ui.css';
import dynamic from "next/dynamic";
type Props = {
spec: Record<string, any>,
};
const SwaggerUI = dynamic(() => import('swagger-ui-react'), { ssr: false });
function Swagger({ spec }: Props) {
return <SwaggerUI spec={spec} />;
return <SwaggerUI spec={spec}/>;
}
export default Swagger;