Move react-pdf dynamic import

This commit is contained in:
Gregory Schier committed 2025-05-25 20:39:14 -07:00
1 parent 101582e540
commit 245054cd7d
3 files changed
+27 -7

No files matched your search

@@ -7,13 +7,6 @@ import React, { useRef, useState } from 'react';
import { Document, Page } from 'react-pdf';
import { useContainerSize } from '../../hooks/useContainerQuery';
import('react-pdf').then(({ pdfjs }) => {
pdfjs.GlobalWorkerOptions.workerSrc = new URL(
'pdfjs-dist/build/pdf.worker.min.mjs',
import.meta.url,
).toString();
});
interface Props {
bodyPath: string;
}