What is the new or updated feature that you are suggesting?
A React ErrorBoundary componentDidCatch exposes two things:
My understanding is that React Router implements an ErrorBoundary and forwards the error to errorElement, which can get the error by using useRouterError. However, only the error is accessible, not the info.
My feature request is the following: being able to access, from within the errorElement, to the info.
I understand that getDerivedStateFromError does not expose info, so it might tricky to access it from the errorElement. In this case, an onError(error, info) callback on RouterProvider might also be a solution?
Why should this feature be included?
Currently, we lose this info and, to my knowledge, there's no way to get it back, as we cannot create our own React ErrorBoundary, given the React Router one takes precedence. Am I wrong?
What is the new or updated feature that you are suggesting?
A React
ErrorBoundarycomponentDidCatchexposes two things:error, which is the thrown errorinfo, "An object with a componentStack key containing information about which component threw the error"My understanding is that React Router implements an
ErrorBoundaryand forwards the error toerrorElement, which can get the error by usinguseRouterError. However, only theerroris accessible, not theinfo.My feature request is the following: being able to access, from within the
errorElement, to theinfo.I understand that
getDerivedStateFromErrordoes not exposeinfo, so it might tricky to access it from theerrorElement. In this case, anonError(error, info)callback onRouterProvidermight also be a solution?Why should this feature be included?
Currently, we lose this
infoand, to my knowledge, there's no way to get it back, as we cannot create our own ReactErrorBoundary, given the React Router one takes precedence. Am I wrong?