-
Notifications
You must be signed in to change notification settings - Fork 115
Open
Description
Hi Team,
I am getting abortError & I have pasted by code below. Please let know if you have any solution
My Code:
import dynamic from 'next/dynamic';
import { DocumentViewerProps } from "@/Interface/DocumentViewer"
import { useEffect, useState } from 'react';
const DocViewer = dynamic(() => import('react-doc-viewer'), { ssr: false });
const DocumentViewer: React.FC = ({
URL,
}) => {
const [documents, setDocuments] = useState([]);
useEffect(() => {
if (URL) {
const docs = [{ uri: URL }];
setDocuments(docs);
}
}, [URL]);
return (
<div>
{documents.length > 0 ? (
<DocViewer documents={documents} />
) : (
<p>Loading documents...</p>
)}
</div>
);
}
export default DocumentViewer
Metadata
Metadata
Assignees
Labels
No labels