You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Exceptionless React package provides a native way to handle errors and events in React. This means errors inside your components, which tend to crash your entire app, can be sent to Exceptionless and you can be alerted. Additionally, you can use this package to catch errors throughout your non-component functions such as in Redux actions, utility functions, etc.
3
+
The Exceptionless React package provides a native way to handle errors and events in React. This means errors inside your components, which tend to crash your entire app, can be sent to Exceptionless and you can be alerted. Additionally, you can use this package to catch errors throughout your non-component functions such as in Redux actions, utility functions, etc.
4
4
5
-
###Getting Started
5
+
## Getting Started
6
6
7
-
To use this package, your must be using ES6 and Node 15+.
7
+
To use this package, your must be using ES6 and Node 15+.
8
8
9
-
**Install**
9
+
### Install
10
10
11
-
NPM:
11
+
NPM:
12
12
13
-
`npm install @exceptionless/react`
13
+
`npm install @exceptionless/react`
14
14
15
-
Yarn:
16
-
17
-
`yarn add @exceptionless/react`
18
-
19
-
### Configuration
15
+
## Configuration
20
16
21
17
Inside your `index.js` file or your `App.js` file, you can configure and start Exceptionless as follows.
22
18
23
-
**Class Components**
19
+
### Class Components
24
20
25
21
```jsx
26
22
classAppextendsComponent {
@@ -45,26 +41,26 @@ class App extends Component {
45
41
exportdefaultApp;
46
42
```
47
43
48
-
###Handling Events
44
+
## Handling Events
49
45
50
-
While errors within the components themselves are automatically sent to Exceptionless, you will still want to handle events that happen outside the components.
46
+
While errors within the components themselves are automatically sent to Exceptionless, you will still want to handle events that happen outside the components.
51
47
52
48
Because the Exceptionless client is a singleton, it is available anywhere in your app where you import it. Here's an example from a file we'll call `utilities.js`.
53
49
54
50
```js
55
-
exportconstmyUtilityFunction= () => {
51
+
exportconstmyUtilityFunction=async() => {
56
52
try {
57
53
// Handle successful run of code
58
54
} catch(e) {
59
55
// If there's an error, send it to Exceptionless
60
-
Exceptionless.submitException(e);
56
+
awaitExceptionless.submitException(e);
61
57
}
62
58
}
63
59
```
64
60
65
-
You can also sent events and logs that are not errors by simply calling the built-in methods on the Exceptionless class:
61
+
You can also sent events and logs that are not errors by simply calling the built-in methods on the Exceptionless class:
The Exceptionless Vue package provides a native way to handle errors and events in React. This means errors inside your components, which tend to crash your entire app, can be sent to Exceptionless and you can be alerted. Additionally, you can use this package to catch errors throughout your non-component functions such as in Redux actions, utility functions, etc.
7
4
8
-
### Compiles and hot-reloads for development
9
-
```
10
-
npm run serve
11
-
```
5
+
## Getting Started
12
6
13
-
### Compiles and minifies for production
14
-
```
15
-
npm run build
16
-
```
7
+
To use this package, your must be using ES6 and Node 15+.
17
8
18
-
### Lints and fixes files
19
-
```
20
-
npm run lint
21
-
```
9
+
### Install
22
10
23
-
### Customize configuration
24
-
See [Configuration Reference](https://cli.vuejs.org/config/).
0 commit comments