ide.tsx 925 B

123456789101112131415161718192021222324252627
  1. import '../utils/webpack-public-path' // configure dynamically loaded assets (via webpack) to be downloaded from CDN
  2. import '../infrastructure/error-reporter' // set up error reporting, including Sentry
  3. import '../infrastructure/hotjar' // set up Hotjar
  4. import { createRoot } from 'react-dom/client'
  5. import IdeRoot from '@/features/ide-react/components/ide-root'
  6. const container = document.getElementById('ide-root')
  7. if (container) {
  8. const root = createRoot(container)
  9. root.render(<IdeRoot />)
  10. }
  11. // work around Safari 15's incomplete support for dvh units
  12. // https://github.com/overleaf/internal/issues/18109
  13. try {
  14. if (
  15. document.body.parentElement &&
  16. document.body.parentElement?.clientHeight < document.body.clientHeight
  17. ) {
  18. const rootElement = document.querySelector<HTMLDivElement>('#ide-root')
  19. if (rootElement) {
  20. rootElement.style.height = '100vh'
  21. }
  22. }
  23. } catch {
  24. // ignore errors
  25. }