React error boundaries #27
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
If a React component throws a runtime error, the entire app crashes to a white screen.
What to do
Add error boundaries to catch and display errors gracefully.
Files to change
apps/web/src/components/ErrorBoundary.tsx— new file. Error boundary with user-friendly fallback.apps/web/src/routes/__root.tsx— wrap the root layout with the error boundary.apps/web/src/routes/play.tsx.Acceptance criteria
Notes
React error boundaries must be class components. Alternatively use
react-error-boundarylibrary for hook-friendly wrapper. App uses Tailwind CSS + shadcn/ui for styling.