Instruction: Explain the concept of error boundaries and describe how to use them to catch JavaScript errors in a component tree.
Context: This question tests the candidate's ability to handle errors gracefully in a React application using error boundaries.