diff --git a/src/App.tsx b/src/App.tsx index 8d7e817d..c18a80c4 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -131,6 +131,17 @@ function NavigationTracker() { } function AppContent(): React.JSX.Element { + // Initialize Cronitor RUM inside BrowserRouter (where history is available) + useEffect(() => { + Cronitor.load("0b5d17d3f7625ce8766c2c4c85c1895d", { + debug: import.meta.env.DEV, // Enable debug logs in development only + trackMode: 'history', // Automatically track page views with React Router + }); + + // Log successful initialization + console.log('[Cronitor] RUM initialized'); + }, []); + return ( @@ -388,33 +399,20 @@ function AppContent(): React.JSX.Element { ); } -const App = (): React.JSX.Element => { - // Initialize Cronitor RUM on app mount - useEffect(() => { - Cronitor.load("0b5d17d3f7625ce8766c2c4c85c1895d", { - debug: import.meta.env.DEV, // Enable debug logs in development only - trackMode: 'history', // Automatically track page views with React Router - }); - - // Log successful initialization - console.log('[Cronitor] RUM initialized'); - }, []); - - return ( - - - - - - - - - - - {import.meta.env.DEV && } - - - ); -}; +const App = (): React.JSX.Element => ( + + + + + + + + + + + {import.meta.env.DEV && } + + +); export default App;