Skip to content

Commit 4c548af

Browse files
authored
fix: read accessibilityLabel from parent's view to avoid performance hit on RN (#259)
* fix: read accessibilityLabel from parent's view to avoid performance hit on RN * fix
1 parent b999bac commit 4c548af

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
## Next
22

3+
- fix: read accessibilityLabel from parent's view to avoid performance hit on RN ([#259](https://github.com/PostHog/posthog-ios/pull/259))
4+
35
## 3.15.5 - 2024-11-19
46

57
- fix: properly mask SwiftUI Text (and text-based views) ([#257](https://github.com/PostHog/posthog-ios/pull/257))

PostHog/Replay/UIView+Util.swift

+3-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@
2222
if let identifier = accessibilityIdentifier {
2323
isNoCapture = checkLabel(identifier)
2424
}
25-
if let label = accessibilityLabel, !isNoCapture {
25+
// read accessibilityLabel from the parent's view to skip the RCTRecursiveAccessibilityLabel on RN which is slow and may cause an endless loop
26+
// see https://github.com/facebook/react-native/issues/33084
27+
if let label = super.accessibilityLabel, !isNoCapture {
2628
isNoCapture = checkLabel(label)
2729
}
2830

0 commit comments

Comments
 (0)