---
# System prepended metadata

title: Error view
tags: [brew-js-react]

---

---
tags: brew-js-react
---

# Error view

==Since `v0.3.1`==

View container itself is an error boundary. That means when view component failed to render, only content in view container is cleared.

Starting from 0.3.1, `registerErrorView` allows a default view to be rendered when view component failed to render.

```typescript
registerErrorView(({ error, reset }) => (
    return (
        <div>
            <p>Oops!</p>
            <button onClick={reset}>Reload page</button>
        </div>
    );
));
```

:::warning
Note that error view should be used as the last resort to display message to user and allow recovery. Expected application errors should be handled gracefully in view components.
:::