State Management · Middle · Question 70 of 75
What happens when a React Router loader throws?
- ✓Correct answer: The nearest route
ErrorBoundaryrenders instead of the route component - 2The app crashes with a blank page
- 3The error is ignored and
useLoaderDatareturnsundefined
Explanation
Inside the boundary useRouteError() returns the error; isRouteErrorResponse distinguishes thrown responses like 404 from unexpected errors.