React Error Boundary + error reporting hook

13979
0

Frontend errors are inevitable, so I’d rather control the blast radius. I wrap unstable sections with an ErrorBoundary that shows a friendly fallback and captures context for reporting. I also avoid spamming the error tracker by including a fingerprint (route + component) and sampling when necessary. The important part isn’t just the stack trace—it’s the breadcrumbs: user id (non-PII), feature flag state, and recent actions so I can reproduce the bug. This pattern makes the app feel more reliable even when something goes wrong, and it cuts investigation time because you’re not starting from a blank page.