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/react-native/touchevents.mdx
+16-17Lines changed: 16 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -52,40 +52,39 @@ Each touch event is automatically logged as a breadcrumb and displays on the das
52
52
53
53
## Tracking Specific Components
54
54
55
-
You can let Sentry know which components to track specifically by setting the `displayName` property for them. If Sentry detects a component with a `displayName` within a touch's component tree, it will be logged on the dashboard as having occurred in that component.
55
+
You can let Sentry know which components to track specifically by passing the `sentry-label` prop to them. If Sentry detects a component with a `sentry-label` within a touch's component tree, it will be logged on the dashboard as having occurred in that component. If we cannot find a component with the label, we will fall back to the `accessibilityLabel` prop.
56
56
57
57
```javascript
58
-
classYourCoolComponentextendsReact.Component {
59
-
static displayName ="CoolComponent";
60
-
render() {
61
-
return<View>{/* ... */}</View>;
62
-
}
63
-
}
58
+
constYourCoolComponent=props=> {
59
+
return (
60
+
<View sentry-label="CardContainer">
61
+
<Text sentry-label="CoolText">
62
+
You are cool
63
+
</Text>
64
+
</View>
65
+
);
66
+
};
64
67
```
65
68
66
-
or
69
+
<Note>
67
70
68
-
```javascript
69
-
constYourCoolComponent=props=> {
70
-
return<View>{/* ... */}</View>;
71
-
};
71
+
You don't have to worry about Typescript errors when passing the `sentry-label` prop. [Typescript will not throw an error on props with the '-' character](https://www.typescriptlang.org/docs/handbook/jsx.html#attribute-type-checking).
72
72
73
-
YourCoolComponent.displayName="CoolComponent";
74
-
```
73
+
</Note>
75
74
76
75
## Options
77
76
78
77
You can pass specific options to configure the boundary either as props to the `Sentry.TouchEventBoundary` component or as the second argument to the `Sentry.withTouchEventBoundary` higher-order component (HOC).
: _Array<string|RegExp>, Accepts strings and regular expressions_. (New in version 1.7.0) Component names to ignore when logging the touch event. This prevents unhelpful logs such as "Touch event within element: View" where you still can't tell which `View` it occurred in.
105
+
: _Array<string|RegExp>, Accepts strings and regular expressions_. Component names to ignore when logging the touch event. This prevents unhelpful logs such as "Touch event within element: View" where you still can't tell which `View` it occurred in.
0 commit comments