You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
componentStack is not available to errorComponent or defaultErrorComponent #2512
Even though info?: { componentStack: string; } appears in ErrorComponentProps, it is never passed to the error component.
The error info with the component stack is captured though, as it is logged to the console as warning and it is passed to onCatch and defaultOnCatch.
Navigate to that route and see that the component stack is undefined.
In the linked MCVE example, the about route is throwing an error. Opening the link and navigating to the About page will reproduce this.
Expected behavior
The same errorInfo with the component stack that is passed to onCatch as its second parameter would also be passed to the error component in the info prop.
Activity
schiller-manuel commentedon Oct 12, 2024
Since setting state in
componentDidCatchis deprecated, we cannot do much here, asgetDerivedStateFromErrordoes not exposeerrorInfohttps://react.dev/reference/react/Component#componentdidcatch-caveats
The best "solution" would probably be to remove
errorInfofromErrorComponentPropsSeanCassiere commentedon Oct 26, 2024
Added this removal of errorInfo onto the v2 checklist.
#975
Closing this for now.