This commit is contained in:
2025-01-18 14:32:15 +01:00
parent 00d7fe1bf1
commit 6a0820772d
3 changed files with 1 additions and 40 deletions

View File

@@ -11,13 +11,10 @@ import {
} from '@remix-run/react'
import stylesheet from '~/tailwind.css?url'
import { PropsWithChildren, useEffect } from 'react'
import posthog from 'posthog-js'
import { captureRemixErrorBoundaryError, withSentry } from '@sentry/remix'
export const ErrorBoundary = () => {
const error = useRouteError()
captureRemixErrorBoundaryError(error)
return <div>Something went wrong. Please try again later.</div>
}
@@ -54,19 +51,8 @@ export function Layout({ children }: PropsWithChildren) {
function App() {
return (
<>
<CapturePageView />
<Outlet />
</>
)
}
export default withSentry(App)
function CapturePageView() {
const location = useLocation()
useEffect(() => {
posthog.capture('$pageview')
}, [location])
return null
}
export default App