Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

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

Đang mở
#1,486 3 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 2 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
62/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
react-native, typescript
Lĩnh vực
mobile

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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

Ngôn ngữ chính
TypeScript
Star
145
Fork
65
Merge trung bình
2 ngày 16 giờ
Pull request đã merge (30 ngày)
19

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của DataDog/dd-sdk-reactnative

Tất cả issue của DataDog/dd-sdk-reactnative

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.