Robby Dore

React ErrorBoundaries

Robby Dore | Nov 16, 2018

React breaks up our UI into separate, reusable components which makes organizing code much easier. However, if one of those components breaks, it crashes the rest of your UI. ErrorBoundary components catch errors in any of their children components allowing you to replace a broken child component with any code you want. In this screencast, we'll show you how to build a React ErrorBoundary component that will help keep your UI working even when there are errors.

For the More Curious...

Production - Create React App
Why production is faster than development
More info on componentDidCatch
BNR Guide to Front-End Web Development
Full Stack Courses

Subscribers Only

Transcripts are for subscribers. Create an account today to access our collection of screencasts, skill packs, and more.

Subscribers Only

Project files are only available for subscribers. Create an account today to access our collection of screencasts, skill packs, and more.

Need Help?

If you get stuck, try starting a discussion with Big Nerd Ranch experts in the community tab.

Related Screencasts

Explore other screencasts related to this topic.

Room Architecture

6 minutes

While Android SDK provides the APIs for using SQLite databases, they force developers to write a lot of boilerplate code. Room solves this problem by creating the glue code that saves objects to SQLite and reads them into memory. In addition, it performs some compile-time checks to ensure correctness of SQL queries.


7 minutes

In the previous video you learned about Room, the object persistence architecture component but we had to use the AsyncTask to perform database access in a background thread. LiveData makes it easier to perform Room's database queries on Android, since it takes care of the activity lifecycle.


6 minutes

In the third video of this series, we’ll add ViewModel to our application. Instead of calling the repository or other components directly from the Activity or Fragment, we can put some of that code in the ViewModel. As a result, our application will become much cleaner and it will be more testable.

Breaking API Changes for Good

6 minutes

hat happens when you have a bug in your API, and you need to fix it for some clients (the updated ones), but not for others? This screencast illustrates a strategy for adjusting an API's behavior for specific clients. We'll be using the Ruby on Rails framework emitting JSON to demonstrate this important web and API concept.

Mocking Basics

6 minutes

Unit testing your classes helps ensure that they work correctly based on controlled inputs but doing the setup can be painful if you have a lot of dependencies. Learn how to create mock objects using Mockito to simplify your setup and improve the readability of your tests.

Mock vs Spy

6 minutes

There are a wide variety of test doubles you can use to make testing easier. In this video we will discuss mocks and spies, what their differences are and when you would use each of them.