From b715072335071862ac97523c9ed59af7ae737013 Mon Sep 17 00:00:00 2001 From: Antonis Lilis Date: Fri, 16 Jan 2026 16:07:29 +0100 Subject: [PATCH 1/2] React Native: Add iOS session replay view filtering documentation --- .../react-native/session-replay/index.mdx | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/docs/platforms/react-native/session-replay/index.mdx b/docs/platforms/react-native/session-replay/index.mdx index 2190364db42052..b43e0b0de368d1 100644 --- a/docs/platforms/react-native/session-replay/index.mdx +++ b/docs/platforms/react-native/session-replay/index.mdx @@ -244,3 +244,27 @@ Errors that happen while a replay is running will be linked to the replay, makin - The replay was rate-limited and couldn't be accepted. - The replay was deleted by a member of your org. - There were network errors and the replay wasn't saved. + +## Troubleshooting + +### Crashes During View Hierarchy Traversal on iOS + +_Available in version 7.9.0 of the React Native SDK_ + +When capturing session replays on iOS, the SDK traverses the view hierarchy to capture screenshots and view information. Some view hierarchies may contain problematic views that can cause crashes during traversal. You can prevent these crashes by filtering which views are included or excluded from traversal. Use `includedViewClasses` to only traverse specific view classes (only views that are instances of these classes or their subclasses will be traversed), or `excludedViewClasses` to skip problematic view classes (views of these classes or their subclasses will be skipped entirely, including all their children). If both `includedViewClasses` and `excludedViewClasses` are set, `excludedViewClasses` takes precedence: views matching excluded classes won't be traversed even if they match an included class. + +```javascript {tabTitle:Mobile} +import * as Sentry from "@sentry/react-native"; + +Sentry.init({ + dsn: "___PUBLIC_DSN___", + replaysSessionSampleRate: 0.1, + replaysOnErrorSampleRate: 1.0, + integrations: [ + Sentry.mobileReplayIntegration({ + includedViewClasses: ['UILabel', 'UIView', 'MyCustomView'], + excludedViewClasses: ['WKWebView', 'UIWebView'], + }), + ], +}); +``` From c420e2fd8dc31069bc1f746b8c0742497ef2ad31 Mon Sep 17 00:00:00 2001 From: Antonis Lilis Date: Fri, 16 Jan 2026 17:21:58 +0100 Subject: [PATCH 2/2] Update wording in supported versions Co-authored-by: LucasZF --- docs/platforms/react-native/session-replay/index.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/platforms/react-native/session-replay/index.mdx b/docs/platforms/react-native/session-replay/index.mdx index b43e0b0de368d1..441cfde5ba4a65 100644 --- a/docs/platforms/react-native/session-replay/index.mdx +++ b/docs/platforms/react-native/session-replay/index.mdx @@ -249,7 +249,7 @@ Errors that happen while a replay is running will be linked to the replay, makin ### Crashes During View Hierarchy Traversal on iOS -_Available in version 7.9.0 of the React Native SDK_ +_Supported in React Native SDK v7.9.0 and later_ When capturing session replays on iOS, the SDK traverses the view hierarchy to capture screenshots and view information. Some view hierarchies may contain problematic views that can cause crashes during traversal. You can prevent these crashes by filtering which views are included or excluded from traversal. Use `includedViewClasses` to only traverse specific view classes (only views that are instances of these classes or their subclasses will be traversed), or `excludedViewClasses` to skip problematic view classes (views of these classes or their subclasses will be skipped entirely, including all their children). If both `includedViewClasses` and `excludedViewClasses` are set, `excludedViewClasses` takes precedence: views matching excluded classes won't be traversed even if they match an included class.