👀 React 19 canary - New API documented
Useful to enhance a custom error overlay
(Next.js is actively working on a new one, using this API)
captureOwnerStack() !== componentStack
Owners create the JSX node
Comp render props.children => not owner
https://react.dev/reference/react/captureOwnerStack
Useful to enhance a custom error overlay
(Next.js is actively working on a new one, using this API)
captureOwnerStack() !== componentStack
Owners create the JSX node
Comp render props.children => not owner
https://react.dev/reference/react/captureOwnerStack
Comments
- render
- useEffect
- handlers (onClick etc)
- root handlers (onCaughtError etc)
Example usage coming in Next.js error overlay where React console warnings can display more useful info:
https://reacttraining.com/blog/react-owner-components