Some third party libraries involve components that have compatibility issues with the react-component-annotate plugin, and results in errors when the data-sentry properties are added as props. This PR introduces a bit of a bandaid fix by introducing an option to allow users to configure the names of components that should not have any annotations applied.
When using the standalone Babel plugin, you can configure this option like so:
// babel.config.js
{
// ... other config above ...
plugins: [
// Put this plugin before any other plugins you have that transform JSX code
// The options are set by providing an object as the second element in the array, but not required
['@sentry/babel-plugin-component-annotate', {ignoreComponents: ['Foo', 'Bar']}]
],
}
When using the Sentry bundler plugins, you can configure this option like so:
TODO: Add tests and allow providing a source file location, since it is possible for multiple components to have the same name, but you may not want to skip annotation on all of these.
Some third party libraries involve components that have compatibility issues with the
react-component-annotate
plugin, and results in errors when thedata-sentry
properties are added as props. This PR introduces a bit of a bandaid fix by introducing an option to allow users to configure the names of components that should not have any annotations applied.When using the standalone Babel plugin, you can configure this option like so:
When using the Sentry bundler plugins, you can configure this option like so:
TODO: Add tests and allow providing a source file location, since it is possible for multiple components to have the same name, but you may not want to skip annotation on all of these.