Skip to content

Commit

Permalink
Revert "docs: remove outdated FAQ"
Browse files Browse the repository at this point in the history
This reverts commit 400d313.
  • Loading branch information
KubaJastrz committed May 30, 2023
1 parent 400d313 commit 27c82e7
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,4 +180,32 @@ const ComponentWithErrorBoundary = withErrorBoundary(ExampleComponent, {

---

# FAQ
## `ErrorBoundary` cannot be used as a JSX component
This error can be caused by a version mismatch between [react](https://npmjs.com/package/react) and [@types/react](https://npmjs.com/package/@types/react). To fix this, ensure that both match exactly, e.g.:

If using NPM:
```json
{
...
"overrides": {
"@types/react": "17.0.60"
},
...
}
```

If using Yarn:
```json
{
...
"resolutions": {
"@types/react": "17.0.60"
},
...
}
```

---

[This blog post](https://kentcdodds.com/blog/use-react-error-boundary-to-handle-errors-in-react) shows more examples of how this package can be used, although it was written for the [version 3 API](https://github.com/bvaughn/react-error-boundary/releases/tag/v3.1.4).

0 comments on commit 27c82e7

Please sign in to comment.