Loading tutorials
throw and try/catch. The next chapter covers the full class implementatio6 min readextends, static, this). You should also have seen the idea of an error boundary from the previous chapter. Here you write one by hand and learn what each part does.6 min readgetDerivedStateFromError stores an error in state. Here the focus is on what the boundary renders after it catches an error.5 min readgetDerivedStateFromError and componentDidCatch, as in the earlier chapters, and that you are comfortable with try/catch and async/await.6 min readtry/catch and async/await work, and you have read the earlier chapters on what boundaries catch. It covers how to send errors from event handlers and asynchronous code into a boundary when you want the boundary's fal6 min readErrorBoundary from the earlier chapter. It takes a fallback prop and shows it after a descendant throws during rendering. It also assumes you know which errors boundaries do not catch. Here the question is where in the component tree to put them6 min readgetDerivedStateFromError, and that you know where boundaries do and don't catch errors. It also assumes you have used React state and useEffect. Here you will learn how a boundary leaves its failed state, and how to offer retri5 min readasync/await.5 min readgetDerivedStateFromError and componentDidCatch. It also assumes you know which errors boundaries do not catch, and that you have used fetch and async/await. Here you will send the errors a boundary catches to a logging se6 min readgetDerivedStateFromError and componentDidCatch, and understand Promises and import(). You should also know which errors boundaries do not catch, and how to reset one.6 min readcreateRoot from react-dom/client. It also assumes you are on React 19 or later, where these callbacks are available.5 min readreact-error-boundary) and have used render, screen, and userEvent in tests. The examples use Vitest. In Jest, replace vi with4 min read