Skip to content

errorElement never gets called when child Routes are in a <Routes> element #10350

Closed Answered by brophdawg11
jasikpark asked this question in Q&A
Discussion options

You must be logged in to vote

There's a bit of confusion around the usage of <Routes> and <RouterProvider>. I tried to clarify a bit in this comment and this comment, and we will work on improving the docs around this as well.

But <Routes> is definitely supported when using createBrowserRouter - that's the key to the ability to incrementally migrate your app.

However, you cannot include an errorElement on any <Route>'s below a descendant <Routes> though, as is shown in the example above.

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@brophdawg11
Comment options

Answer selected by brophdawg11
@jasikpark
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants