Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumReactReact Router v6Single-choice MCQ

A React Router v6 data-router defines an `errorElement` only on the root route, and a child route's `loader` throws. Where is the error rendered, and what happens to the rest of the layout?

createBrowserRouter([ { path: '/', element: <Root/>, // renders <Outlet/> errorElement: <RootError/>, children: [ { path: 'reports', element: <Reports/>, loader: reportsLoader }, // loader throws ], }, ]);