Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

[actionNameAttribute] prop doesn't accept value with curly braces

Aperta
#1,486 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
62/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
react-native, typescript
Ambito
mobile

Direzione di ricerca

Start by reading the mobile React Native Babel plugin configuration and its handling of the configured actionNameAttribute. Compare how it processes a plain string prop with a value supplied in curly braces, then find the relevant plugin tests or add a focused regression case if the existing tests cover this behavior. Done means the expression value is used as the action name, with the regression case passing.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug
Describe the bug

Hey 👋🏻

I use actionNameAttribute = "testID" in @datadog/mobile-react-native config. And I'm using also @datadog/mobile-react-native-babel-plugin with following config:

{
          actionNameAttribute: "testID",
          components: {
            useContent: true,
            useNamePrefix: true,
            tracked: [
              {
                name: "Button",
                handlers: [{ event: "onPress", action: "TAP" }],
              },
              {
                name: "TextButton",
                handlers: [{ event: "onPress", action: "TAP" }],
              },
              { name: "FAB", handlers: [{ event: "onPress", action: "TAP" }] },
              {
                name: "Checkbox",
                handlers: [{ event: "onPress", action: "TAP" }],
              },
              {
                name: "ListItem",
                handlers: [{ event: "onPress", action: "TAP" }],
              },

Then if testID is added to element with curly braces testID={"some_test_id"} I get aria-label, button content or something like that as action name instead of object property.

If I use plain string as testID it works, for example testID="some_test_id".

Problem is that I would like to have element ids not as plain string but reference to object key value: testID={TestIDs.someTestId} and keep them in one place instead of adding them inline.

Reproduction steps
  1. Add mentioned setup
  2. Add testID to some RN element, remember that test id should be added with curly braces
  3. Tap element to test what's logged as event name
SDK logs

No response

Expected behavior

Event names added with curly braces are sent properly to DD.

Affected SDK versions

3.9.0, 3.10.0

Latest working SDK version
Did you confirm if the latest SDK version fixes the bug?

Yes

Integration Methods

Yarn

React Native Version

0.79.5

Package.json Contents

"@datadog/mobile-react-native": "3.9.0",
"@datadog/mobile-react-native-babel-plugin": "3.9.0",
"@datadog/mobile-react-native-session-replay": "3.9.0",
"@datadog/mobile-react-navigation": "3.9.0",
"expo": "^53.0.0",

iOS Setup

No response

Android Setup

No response

Device Information

No response

Other relevant information

No response

Lingua principale
TypeScript
Stelle
145
Fork
65
Merge medio
2g 16h
PR unite (30g)
20

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di DataDog/dd-sdk-reactnative

Tutte le issue di DataDog/dd-sdk-reactnative

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.