Browse Source

Fix typo (issue #5678) (#5679)

main
mchammam 2 years ago
committed by GitHub
parent
commit
a45fec9948
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      beta/src/content/reference/react/Component.md

2
beta/src/content/reference/react/Component.md

@ -1321,7 +1321,7 @@ We recommend to define components as functions instead of classes. [See how to m
By default, if your application throws an error during rendering, React will remove its UI from the screen. To prevent this, you can wrap a part of your UI into an *error boundary*. An error boundary is a special component that lets you display some fallback UI instead of the part that crashed--for example, an error message.
To implement an error boundary component, you need to provide [`static getDerivedStateFromError`](#static-getderivedstatefromerror) which lets you update state in response to an error and display an error message to the user. You can also optionally implement [`componentDidcatch`](#componentdidcatch) to add some extra logic, for example, to log the error to an analytics service.
To implement an error boundary component, you need to provide [`static getDerivedStateFromError`](#static-getderivedstatefromerror) which lets you update state in response to an error and display an error message to the user. You can also optionally implement [`componentDidCatch`](#componentdidcatch) to add some extra logic, for example, to log the error to an analytics service.
```js {7-10,12-19}
class ErrorBoundary extends React.Component {

Loading…
Cancel
Save