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
Copy file name to clipboardExpand all lines: src/platforms/javascript/guides/vue/features/component-tracking.mdx
+10-4Lines changed: 10 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -47,19 +47,25 @@ The default is `false`.
47
47
48
48
#### `hooks`
49
49
50
-
Control which lifecycle hooks should be tracked. This is helpful if, for example, you want to know if some components are removed during the initial page load, in which case you can add a `destroy` hook to the default:
50
+
Control which lifecycle hooks should be tracked. This is helpful if, for example, you want to know if some components are removed during the initial page load, in which case you can add a `unmount` hook to the default:
51
51
52
52
```javascript
53
53
Sentry.init({
54
54
// ...
55
55
trackComponents:true
56
-
hooks: ["mount", "update", "destroy"],
56
+
hooks: ["mount", "update", "unmount"],
57
57
});
58
58
```
59
59
60
-
The following hooks are available to track: `['activate', 'create', 'destroy', 'mount', 'update']`
60
+
The following hooks are available to track in Vue 3: `['activate', 'create', 'unmount', 'mount', 'update']`
61
61
62
-
Note that when specifying `hooks`, we use the simple verb rather than `before` and `-ed` pairs. For example, `destroy` is correct, while `beforeDestroy` and `destroyed` are incorrect.
62
+
Note that when specifying `hooks`, we use the simple verb rather than `before` and `-ed` pairs. For example, `unmount` is correct, while `beforeUnmount` and `unmounted` are incorrect.
63
+
64
+
<Alert>
65
+
66
+
In Vue 2, use `destroy` instead of `unmount`. `destroy` does not work in Vue 3, as the names of the lifecycle hooks themselves [changed](https://v3-migration.vuejs.org/breaking-changes/#other-minor-changes) in Vue 3.
67
+
68
+
</Alert>
63
69
64
70
The default set of hooks is `['activate', 'mount', 'update']`.
0 commit comments