Move react-pdf dynamic import

This commit is contained in:
Gregory Schier
2025-05-25 20:39:14 -07:00
parent 101582e540
commit 245054cd7d
3 changed files with 27 additions and 7 deletions

View File

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