Introduction

Let's take a look at how to catch errors anywhere in the component tree, log those errors, and display a fallback UI instead of the component tree that crashed.

We'll cover the following...

What are Error Boundaries?

Whenever an error occurs, and an exception is thrown in a React application, there is a strong possibility that the application display no longer works and that the user will only see a blank page. To avoid this behavior, React introduced error boundaries in version 16.0.

An error boundary describes a component that can catch certain errors in its children and can also render an alternative component tree to protect users from experiencing a blank ...