callstack / callstack/react-native-paper

Dialog.Actions spreads compact prop into Fragment in React Native 0.81 / React 19, causing error when dismissing Dialog

Đang mở
#4,794 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
bug
Ngôn ngữ chính
TypeScript
Star
14.5k
Fork
2.2k
Merge trung bình
5 ngày 23 giờ
Pull request đã merge (30 ngày)
12

Mô tả

### Current behaviour
When dismissing a Dialog (via any method — Cancel button inside Dialog.Actions, swipe-back gesture, or tapping outside the dialog), React Native 0.81 (with React 19.1.0) throws the following console error:
Invalid prop `compact` supplied to `React.Fragment`.
React.Fragment can only have `key` and `children` props.

### Expected behaviour
Dismissing a Dialog should not cause console errors. Props like compact should not be passed to React.Fragment.

### How to reproduce?

1. Create a Dialog with Dialog.Actions containing two Buttons, e.g.:

`
Title

Message


<>
Cancel
OK


`

2. Open the dialog.

3. Dismiss the dialog by:

- Pressing the Cancel button
- Swiping back (Android)
- Tapping outside the dialog container

4. Observe the console error.

### Preview
Console error log on dismiss:
console.js:661 Invalid prop `compact` supplied to `React.Fragment`.
React.Fragment can only have `key` and `children` props.

### What have you tried so far?

- Replaced <>... with ... → fixes the issue.
- Verified no compact prop is explicitly passed from my code.
- Confirmed that error appears only after upgrading to React Native 0.81.0 (React 19.1.0).
- Tried using React.Fragment explicitly → same error.
- This suggests Dialog.Actions is injecting compact into children.

### Your Environment

| software | version
| --------------------- | -------
| ios | x
| android | 10
| react-native | 0.81.0
| react-native-paper | ^5.13.1
| node | 22.11.0
| npm or yarn | 1.22.22(yarn)
| expo sdk | Not using Expo(using rn-cli)

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Bắt đầu bằng cách kiểm tra triển khai của Dialog.Actions và cách nó xử lý các phần tử con khi một Dialog bị đóng. Tái hiện vấn đề với React Native 0.81, React 19.1.0 và các Buttons được bọc trong fragment như mô tả ở trên. Hoàn tất khi việc đóng Dialog không còn ghi lại lỗi compact-prop của React.Fragment, đồng thời vẫn giữ nguyên ví dụ gồm hai nút.

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

Đánh giá

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

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.