renderMain.tsx 557 B

1234567891011121314151617181920
  1. import {ROOT_ELEMENT} from 'sentry/constants';
  2. import Main from 'sentry/main';
  3. import {renderDom} from './renderDom';
  4. export function renderMain() {
  5. try {
  6. renderDom(Main, `#${ROOT_ELEMENT}`);
  7. } catch (err) {
  8. if (err.message === 'URI malformed') {
  9. // eslint-disable-next-line no-console
  10. console.error(
  11. new Error(
  12. 'An unencoded "%" has appeared, it is super effective! (See https://github.com/ReactTraining/history/issues/505)'
  13. )
  14. );
  15. window.location.assign(window.location.pathname);
  16. }
  17. }
  18. }