Issue Body (Example):
💡 Problem: Currently, to implement an Error Boundary in a React application (a component that catches JavaScript errors anywhere in its child component tree, logs those errors, and displays a fallback UI), developers must use a Class Component with the componentDidCatch lifecycle method. This breaks the pattern of using hooks/functional components for the rest of the application.
🚀 Proposed Feature: Introduce a new hook, perhaps useErrorBoundary, that allows a Functional Component to act as an Error Boundary.