Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

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

Abierto
#1,486 3 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 2 días

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
62/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
react-native, typescript
Área
mobile

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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

Lenguaje dominante
TypeScript
Estrellas
145
Forks
65
Merge medio
2 d 16 h
PR fusionados (30 d)
20

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de DataDog/dd-sdk-reactnative

Todos los issues de DataDog/dd-sdk-reactnative

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.