Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Apply suggestions from code review
Co-authored-by: Krystof Woldrich <[email protected]>
  • Loading branch information
bruno-garcia and krystofwoldrich authored Jul 15, 2024
commit 6e02345b3115b536affcc79a447f4f39640dc138
13 changes: 6 additions & 7 deletions docs/platforms/react-native/session-replay/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -101,18 +101,18 @@ Sentry.mobileReplayIntegration({

## React Component Names

Sentry helps you capture your React components and unlock additional insights in your application. You can set it up to use React component names instead of selectors.
Sentry helps you capture your React components and unlock additional insights in your application. You can set it up to use React component names.

So instead of looking at selectors like this:
So instead of looking at this:

```html
button.en302zp1.app-191aavw.e16hd6vm2[role="button"][data-test-id="common-options"]
```html {tabTitle:Generic Components}
View > Touchable > View > Text
```

You can also see exactly which React component was used, like:

```html
CommonOptions
```html {tabTitle:React Components}
MyCard (View, MyCard.ts) > MyButton (Touchable, MyCard.ts) > View > Text
```

To add React Component Names use `annotateReactComponents` in `metro.config.js`.
Expand All @@ -124,7 +124,6 @@ module.exports = withSentryConfig(getDefaultConfig(__dirname), { annotateReactCo
```

```js {tabTitle: Expo}
// For Expo
const { getSentryExpoConfig } = require("@sentry/react-native/metro");
const config = getSentryExpoConfig(__dirname, { annotateReactComponents: true });
```
Expand Down