-- **React 19 root error callbacks**: `ReactOnRails.setOptions({ rootErrorHandlers: { onRecoverableError, onCaughtError, onUncaughtError } })` registers React's root error callbacks globally; React on Rails applies them to every `hydrateRoot`/`createRoot` call it makes and invokes them with an extra context argument containing the component name and DOM id. In development, recoverable hydration errors now log an actionable React on Rails message (component name, dom id, and a link to the new [Debugging Hydration Mismatches guide](https://reactonrails.com/docs/building-features/debugging-hydration-mismatches)) instead of React's bare console line. On React <19 (and <18 for `onRecoverableError`), registration is a graceful no-op with a console warning. On React on Rails Pro RSC/streaming hydration paths, user callbacks chain with (never replace) Pro's internal recoverable-error handler. Addresses [Issue 3892](https://github.com/shakacode/react_on_rails/issues/3892). [PR XXXX](https://github.com/shakacode/react_on_rails/pull/XXXX) by [justin808](https://github.com/justin808).
0 commit comments