Capture a Vue descendant error or wrap a React error boundary
Answer: onErrorCaptured() registers a hook after a descendant error has been captured. React uses an Error Boundary to display some fallback UI instead of the part that crashed.
What Vue captures
Errors can be captured from component renders, event handlers, lifecycle hooks, the setup() function, watchers, custom directive hooks, and transition hooks. The hook is given the error, the component instance that triggered it, and an information string for the error source type. The callback can return a boolean or void.
React's fallback UI
A render error can cause React to remove its UI from the screen. An Error Boundary wraps a part of the tree and shows fallback UI, for example an error message. Error boundaries do not catch errors for event handlers, which Vue's hook can capture. Error boundaries do not catch errors for event handlers, which Vue can capture.
| onErrorCaptured() | hook | |---|---| | onErrorCaptured() | Vue hook for a descendant error | | setup() and watchers | Some of the Vue sources that can be captured | | fallback UI | What a React Error Boundary can display | | event handlers | Caught by Vue's hook; not caught by an Error Boundary |
See also
Claims
- id: C1 claim: onErrorCaptured registers a hook when an error from a descendant component is captured. source: S1 evidence: "error propagating from a descendant component has been captured"
- id: C2 claim: Vue can capture errors from renders, event handlers, lifecycle hooks, setup(), and more. source: S1 evidence: "Component renders"
- id: C3 claim: A React Error Boundary can show fallback UI instead of the part that crashed. source: S2 evidence: "display some fallback UI instead of the part that crashed"
Sources
- [S1] onErrorCaptured(). Vue docs. https://vuejs.org/api/composition-api-lifecycle.html . License: CC-BY-4.0. Accessed 2026-11-19.
- [S2] Component. React docs. https://react.dev/reference/react/Component#catching-rendering-errors-with-an-error-boundary . License: CC-BY-4.0. Accessed 2026-11-19.
License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: Vue docs, onErrorCaptured(); React docs, Component. CC-BY-4.0; CC-BY-4.0. Text was condensed and changed from the originals.
License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: Vue docs, onErrorCaptured(); React docs, Component. CC-BY-4.0; CC-BY-4.0.
Cite this
iinventedlight. 2026. "Capture a Vue descendant error or wrap a React error boundary." iinventedlight Library, iil:note:vz0jbjnw, version of 2026-11-19. https://iinventedlight.com/library/notes/vue-error-captured/. License: CC-BY-4.0.
@misc{iil_note_vz0jbjnw,
author = {{iinventedlight}},
title = {{Capture a Vue descendant error or wrap a React error boundary}},
howpublished = {iinventedlight Library},
year = {2026},
date = {2026-11-19},
url = {https://iinventedlight.com/library/notes/vue-error-captured/},
note = {Permanent ID iil:note:vz0jbjnw. License: CC-BY-4.0.},
}
Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).
Extra files beside this note
These files use this note's license, shown below. Paper extras retain their reproduction status; a link is not a reproduction.
- vue-error-captured.table.json (table; CC-BY-4.0)
- vue-error-captured.schema.json (schema; CC-BY-4.0)
For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/vue-error-captured.md.