pdf-preview-detached-root.js 667 B

1234567891011121314151617181920212223
  1. import ReactDOM from 'react-dom'
  2. import PdfPreview from './pdf-preview'
  3. import { ContextRoot } from '../../../shared/context/root-context'
  4. import { Shortcuts } from './shortcuts'
  5. import PdfPreviewDetachedRootSafariWarning from './pdf-preview-detached-root-safari-warning'
  6. function PdfPreviewDetachedRoot() {
  7. return (
  8. <ContextRoot>
  9. <Shortcuts>
  10. <PdfPreviewDetachedRootSafariWarning />
  11. <PdfPreview />
  12. </Shortcuts>
  13. </ContextRoot>
  14. )
  15. }
  16. export default PdfPreviewDetachedRoot // for testing
  17. const element = document.getElementById('pdf-preview-detached-root')
  18. if (element) {
  19. ReactDOM.render(<PdfPreviewDetachedRoot />, element)
  20. }