-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.tsx
More file actions
34 lines (30 loc) · 1.02 KB
/
index.tsx
File metadata and controls
34 lines (30 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import React from 'react';
import ReactDOM from 'react-dom/client';
import App from './App';
import ChunkErrorBoundary from './components/ChunkErrorBoundary';
import './index.css';
// Lazy load error tracking (Sentry) - not needed on initial render
if (!import.meta.env.DEV) {
import('./services/errorTracking').then(({ initErrorTracking }) => {
initErrorTracking();
});
}
// HashRouter deep-link normalization: redirect /jobs → /#/jobs
// Bookmarked or shared URLs without the hash prefix won't match HashRouter routes
const { pathname } = window.location;
if (pathname !== '/' && !pathname.startsWith('/#')) {
const hash = `#${pathname}${window.location.search}`;
window.history.replaceState(null, '', `/${hash}`);
}
const rootElement = document.getElementById('root');
if (!rootElement) {
throw new Error("Could not find root element to mount to");
}
const root = ReactDOM.createRoot(rootElement);
root.render(
<React.StrictMode>
<ChunkErrorBoundary>
<App />
</ChunkErrorBoundary>
</React.StrictMode>
);