Skip to content

Commit f66a079

Browse files
update docs for vue 3 component tracking update (#8547)
* update docs for vue 3 * Update src/platforms/javascript/guides/vue/features/component-tracking.mdx --------- Co-authored-by: Shana Matthews <[email protected]>
1 parent 14afac2 commit f66a079

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/platforms/javascript/guides/vue/features/component-tracking.mdx

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,19 +47,25 @@ The default is `false`.
4747

4848
#### `hooks`
4949

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:
5151

5252
```javascript
5353
Sentry.init({
5454
// ...
5555
trackComponents: true
56-
hooks: ["mount", "update", "destroy"],
56+
hooks: ["mount", "update", "unmount"],
5757
});
5858
```
5959

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']`
6161

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>
6369

6470
The default set of hooks is `['activate', 'mount', 'update']`.
6571

0 commit comments

Comments
 (0)