renderMain.tsx 512 B

12345678910111213141516171819
  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. console.error(
  10. new Error(
  11. 'An unencoded "%" has appeared, it is super effective! (See https://github.com/ReactTraining/history/issues/505)'
  12. )
  13. );
  14. window.location.assign(window.location.pathname);
  15. }
  16. }
  17. }