Taps on a `Pressable` with more than one child are not tracked
I maintainer di solito rispondono entro 2 giorni
@cdn34dd ci sta già lavorando.
Dal 21/10/2026.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 68/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- javascript, react-native, typescript
Direzione di ricerca
Start by reading the startTracking and stopTracking code mentioned in the report, then inspect the JSX runtime interception and related unit tests for interceptOnPress. Reproduce with a release or dev=false bundle using a Pressable with multiple children, and compare its behavior with the one-child case. Done when taps on both named and unnamed multi-child Pressable components produce RUM actions and the tests cover the behavior.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Describe the bug
Taps on a React Native Pressable with more than one child are not reported to RUM. The handler of the app runs, but the SDK adds no action. This happens with and without dd-action-name, in a bundle with __DEV__ === false.
We found it while naming our taps. Many taps were reported as RCTView, so we added dd-action-name to our buttons. It worked for most of them. On some buttons the name never showed up, and the tap was not in RUM at all, even though the button worked in the app.
In our tests with the buttons below:
- A
Pressablewith one child: tap reported. - A
Pressablewith more than one child: no tap reported. - A
Pressablewith more than one child inside a parent that receivesonPressand passes it down: tap reported.
A TouchableOpacity with more than one child was fine in our tests.
We suspect it has to do with jsxs. Babel uses it for elements with more than one child, and startTracking replaces only jsx. We did not verify this on a device. Only on an emulator.
Reproduction steps
- Use a bundle with
__DEV__ === false(a release build, or Metro withdev=false). SetverbositytoDEBUG. - Render this and tap each button once, in order:
import { Pressable, Text } from 'react-native'
const Owner = ({ onPress, name }: { onPress: () => void; name?: string }) => (
<Pressable onPress={onPress} dd-action-name={name}>
<Text>Two children</Text>
<Text>Second child</Text>
</Pressable>
)
export const Repro = () => (
<>
<Pressable onPress={() => console.log('DUMMY handler ran: A named, one child')} dd-action-name="Dummy A named, one child">
<Text>A</Text>
</Pressable>
<Pressable onPress={() => console.log('DUMMY handler ran: B named, two children')} dd-action-name="Dummy B named, two children">
<Text>B</Text>
<Text>Second child</Text>
</Pressable>
<Owner onPress={() => console.log('DUMMY handler ran: C named, owner passes onPress')} name="Dummy C named, owner passes onPress" />
<Pressable onPress={() => console.log('DUMMY handler ran: D unnamed, one child')}>
<Text>D</Text>
</Pressable>
<Pressable onPress={() => console.log('DUMMY handler ran: E unnamed, two children')}>
<Text>E</Text>
<Text>Second child</Text>
</Pressable>
<Owner onPress={() => console.log('DUMMY handler ran: F unnamed, owner passes onPress')} />
</>
)
Here is a recording of that test:
https://github.com/user-attachments/assets/6f903af7-56e1-4947-81b0-9e9ebc32c57a
SDK logs
Output of the component above in our app, one tap per button, in order. Both "two children" buttons (B and E) have no Adding RUM Action line.
DUMMY handler ran: A named, one child
DATADOG: Adding RUM Action "Dummy A named, one child" (TAP)
DUMMY handler ran: B named, two children
DUMMY handler ran: C named, owner passes onPress
DATADOG: Adding RUM Action "Dummy C named, owner passes onPress" (TAP)
DUMMY handler ran: D unnamed, one child
DATADOG: Adding RUM Action "RCTView" (TAP)
DUMMY handler ran: E unnamed, two children
DUMMY handler ran: F unnamed, owner passes onPress
DATADOG: Adding RUM Action "RCTView" (TAP)
"Owner passes onPress" means a parent component with one child receives onPress and passes the same function to the Pressable with two children.
Expected behavior
A RUM tap action for every Pressable with a handler, as for the one-child case.
We added jsxs next to jsx in a local patch. With the patch, the taps on the Pressable with more than one child are reported in the iOS simulator, and interceptOnPress runs in a unit test with a component that reads props.onPress. Not saying this is the right fix.
const originalJsx = jsxRuntime?.jsx;
+const originalJsxs = jsxRuntime?.jsxs;
...
+if (originalJsxs) {
+ jsxRuntime.jsxs = (...args) => this.patchCreateElementFunction(originalJsxs, args);
+}
stopTracking restores jsxs like jsx.
Affected SDK versions
2.14.9 (tested). The source of 3.10.0 has the same code in startTracking; we did not run 3.10.0.
Latest working SDK version
Unknown. We did not test other versions.
Did you confirm if the latest SDK version fixes the bug?
No
Integration Methods
Yarn
React Native Version
0.81.5
Package.json Contents
"@datadog/mobile-react-native": "^2.x",
"@datadog/mobile-react-navigation": "^2.x",
"expo": "^54.x",
"react": "19.1.0",
"react-native": "0.81.5"
iOS Setup
Podfile.lock has DatadogCore, DatadogInternal, DatadogLogs, DatadogRUM, DatadogTrace, DatadogWebViewTracking, DatadogCrashReporting 2.30.2 and DatadogSDKReactNative 2.14.9. Tested in the iOS simulator only.
Android Setup
com.datadoghq.dd-sdk-android-gradle-plugin 1.21.0, hermesEnabled=true, newArchEnabled=false. The native Datadog libraries (dd-sdk-android-rum, -logs, -trace, -webview) come from the React Native SDK at 2.26.2. We did not test on Android. The issues are in JavaScript, so we expect the same there.
Device Information
No response
Other relevant information
No response
- Lingua principale
- TypeScript
- Stelle
- 146
- Fork
- 67
- Merge medio
- 2g 14h
- PR unite (30g)
- 22
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di DataDog/dd-sdk-reactnative
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 25/100
DataDog/dd-sdk-reactnative#1509 ·
I maintainer di solito rispondono entro 2 giorni
-
[actionNameAttribute] prop doesn't accept value with curly bracesForse già presa Una pull request collegata a questa issue è aperta o già unita. Apertabug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 62/100
DataDog/dd-sdk-reactnative#1486 · 4 commenti ·
I maintainer di solito rispondono entro 2 giorni
-
Expose Android app startup Activity filtering in the React Native SDKForse già presa @sbarrio l’ha presa 13 giorni fa. Apertaenhancement
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
DataDog/dd-sdk-reactnative#1485 · 1 commento · 1 assegnatario ·
I maintainer di solito rispondono entro 2 giorni
-
GraphQL variables with non-ASCII contents will make Apollo Client request throw errorForse già presa @cdn34dd l’ha presa 14 giorni fa. Apertaawaiting response bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 42/100
DataDog/dd-sdk-reactnative#1482 · 2 commenti · 1 reazione · 1 assegnatario ·
I maintainer di solito rispondono entro 2 giorni
-
Interaction tracking records nothing: the babel plugin's injected import makes Metro bundle a second copy of the SDK, so DdBabelInteractionTracking.config is set on a different class than instrumented handlers callForse già presa @cdn34dd l’ha presa 13 giorni fa. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
DataDog/dd-sdk-reactnative#1377 · 1 commento · 1 reazione · 1 assegnatario ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di DataDog/dd-sdk-reactnative
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
chaitin/MonkeyCode#1437 ·
I maintainer di solito rispondono entro 1 giorno
-
rtdb-info-connected-order test: unhandled 'connection is closed' rejection fails the CLI suiteAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 69/100
carbon-design-system/carbon-ai-chat#2615 ·
I maintainer di solito rispondono entro 1 giorno
-
e2e-failure ready-to-code
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
redhat-developer/rhdh-plugin-export-overlays#4486 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
[Bug]: fileUploadMatrix.test.ts URL case does a real DNS lookup and fails offlineForse già presa @r2jaff l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
ComposioHQ/composio#5054 ·
I maintainer di solito rispondono entro 1 giorno