Skip to content

Commit

Permalink
feat: add error handling section to react sdk components (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinperaza authored Jan 20, 2023
1 parent 3f1314f commit b35de28
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/sdks/web/react/components.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -260,3 +260,7 @@ const MyComponent = () => {
| `onBlur` | false | _function_ | true | Event listener. See [On Blur](/docs/sdks/web/javascript/methods#on-blur) |
| `onKeyDown` | false | _function_ | true | Event listener. See [On Keydown](/docs/sdks/web/javascript/methods#on-keydown) |
| `ref` | false | _object/function_ | false | [Ref object](/docs/sdks/web/react#using-refs)/[Callback ref function](https://reactjs.org/docs/refs-and-the-dom.html) to store/receive the Element instance. |

## Error Handling

Any errors occurring during the element mounting phase are thrown intentionally during the render cycle. Consider using React's [error boundaries](https://reactjs.org/docs/error-boundaries.html) to handle these errors gracefully. When using React class components, you can also implement the methods [`getDerivedStateFromError`](https://reactjs.org/docs/react-component.html#static-getderivedstatefromerror) and [`componentDidCatch`](https://reactjs.org/docs/react-component.html#componentdidcatch) to handle component errors appropriately.

1 comment on commit b35de28

@vercel
Copy link

@vercel vercel bot commented on b35de28 Jan 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.