Files
Verso/services/web/frontend/js/features/pdf-preview/components/pdf-preview-detached-root.tsx
T
David 1d648f9755 Merge pull request #23502 from overleaf/dp-pdf-typescript
Convert PDF Preview components to typescript

GitOrigin-RevId: 34594d21143727fa42b8b595aa12125a4dd7ae5e
2025-02-13 09:06:41 +00:00

26 lines
621 B
TypeScript

import ReactDOM from 'react-dom'
import PdfPreview from './pdf-preview'
import useWaitForI18n from '../../../shared/hooks/use-wait-for-i18n'
import { ReactContextRoot } from '@/features/ide-react/context/react-context-root'
function PdfPreviewDetachedRoot() {
const { isReady } = useWaitForI18n()
if (!isReady) {
return null
}
return (
<ReactContextRoot>
<PdfPreview />
</ReactContextRoot>
)
}
export default PdfPreviewDetachedRoot // for testing
const element = document.getElementById('pdf-preview-detached-root')
if (element) {
ReactDOM.render(<PdfPreviewDetachedRoot />, element)
}