Empty guest data makes the scene throw while rendering: what is left on stage with no boundary, and with <Batas>? Then errors from onClick and setTimeout: who…
Why it matters
Late, empty or broken data will come in a real app. Without a boundary, one render error unmounts the whole root: a white screen for every user. With a boundary in the right place, only one part shows "try again" while the rest keeps going. But it does not catch everything, and it does not recover by itself.
The key idea
A boundary catches errors during render, and only those
Common mistakes
try/catch round a render catches nothing A child component is rendered by React later, not when you write its JSX. Only an error boundary (or the react-error-boundary library) catches render errors.
There is no hook version of an error boundary A boundary must be a class component (getDerivedStateFromError / componentDidCatch). The react-error-boundary library wraps it in a nicer API, resetKeys included.
A boundary does not catch errors in a handler or setTimeout Those happen outside render. Catch them yourself with try/catch, or keep the error in state and throw it during render so the boundary shows it.
The fallback stays though the data is right A boundary holds the error in its state until it is reset. Give it a new key after fixing the data (or use resetKeys).
Try it in this playground
No boundary: load the data The whole root is unmounted: the gamelan and the closing go too.
<Batas> round the scene Only the scene is replaced by the gunungan; the gong still sounds.
Throwing in onClick The boundary does not see it: it goes on to window.
Throwing in setTimeout When the timer fires, rendering is long over: it gets past too.