Skip to content

Commit a2c773c

Browse files
authored
docs(react): Add note on ignoring components (#12874)
1 parent 208c246 commit a2c773c

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

docs/platforms/javascript/guides/react/features/component-names.mdx

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,17 +50,28 @@ Follow the instructions in the npm page for the bundler that your project uses:
5050

5151
Please note that although there is a Sentry bundler plugin for **esbuild**, React component name capturing is currently not supported.
5252

53+
5354
Once you've followed the instructions to install the bundler plugin and added it to your bundler's config, enable component name capturing by setting the flag for it to `true`:
5455

5556

5657
```javascript
5758
// Example specific to Vite, see documentation for other bundlers
5859
sentryVitePlugin({
59-
// ... other options above
60-
reactComponentAnnotation: { enabled: true }
60+
// ... other options above
61+
reactComponentAnnotation: {
62+
enabled: true,
63+
// you can ignore components from being annotated with this option
64+
ignoredComponents: ["MyComponentThatShouldNotBeAnnotated"]
65+
}
6166
}),
6267
```
6368

69+
<Alert level="warning">
70+
You can potentially run into errors like `Error: Passing props on "Fragment"!`
71+
72+
To avoid these errors, you can exclude specific components from annotation by using the `ignoredComponents` option, as shown in the example above.
73+
</Alert>
74+
6475
<Alert>
6576

6677
**If you're using Rollup as your bundler**, ensure that you place `sentryRollupPlugin` before any other plugins that transform your JSX.

0 commit comments

Comments
 (0)