Skip to content

Commit

Permalink
ref(react): Add example to create an event (#1021)
Browse files Browse the repository at this point in the history
  • Loading branch information
evanpurkhiser authored May 30, 2019
1 parent 4f207d7 commit 113bfe0
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/collections/_documentation/platforms/javascript/react.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,14 @@ After you've completed setting up a project in Sentry, Sentry will give you a va

On its own, `@sentry/browser` will report any uncaught exceptions triggered from your application.

## Error Boundaries
You can trigger your first event from your development environment by raising an exception somewhere within your application. An example of this would be rendering a button:

```jsx
return <button onClick={methodDoesNotExist}>Break the world</button>;
```
<!-- ENDWIZARD -->

### Error Boundaries

If you’re using React 16 or above, Error Boundaries are an important tool for defining the behavior of your application in the face of errors. Be sure to send errors they catch to Sentry using `Sentry.captureException`. This is also a great opportunity to collect user feedback by using `Sentry.showReportDialog`.

Expand Down Expand Up @@ -59,4 +66,3 @@ class ExampleBoundary extends Component {
}
}
```
<!-- ENDWIZARD -->

0 comments on commit 113bfe0

Please sign in to comment.