How does an error boundary work in React?
n Error Boundary is a React component that catches JavaScript errors in its child
components, logs those errors, and displays a fallback UI. This prevents the entire app from
crashing when an error occurs in a part of the component tree.
Usage: