Closed
Description
The reactRouterV#Instrumentation
is no longer supported in React Router v6. Unlike previous versions of React Router, v6 does not expose the history
object.
I've attempted to solve this personally, so as to unblock myself in my projects: react-router-v6-instrumentation
on NPM.
Example usage:
import { init } from '@sentry/react';
import { render } from 'react-dom';
import { BrowserRouter } from 'react-router-dom';
import useBrowserTracing from 'react-router-v6-instrumentation';
function App() {
const browserTracing = useBrowserTracing();
// Initialize Sentry with the browser tracing integration.
useEffect(() => {
init({
integrations: [browserTracing],
});
}, [browserTracing]);
return <>Hello world!</>;
}
render(
<BrowserRouter>
<App />
</BrowserRouter>,
document.getElementById('root'),
);
I hope this ticket inspires the maintainers to implement (credit? 😆) or unblocks others who are searching for solutions to this issue.