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

DataTable: PassThrough types does not match actual values

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

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
48/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
react, typescript
Lĩnh vực
frontend

Hướng nghiên cứu

Bắt đầu từ các kiểu passthrough của DataTable được expose thông qua PrimeReactPTOptions và lần theo entry point bodyRow(options). So sánh kiểu context được khai báo với DataTableBodyRowContext được mô tả trong issue, sau đó xác minh rằng context của bodyRow được định kiểu nhất quán thay vì là DataTableContext hoặc any.

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

Mô tả

Status: Needs Triage
Describe the bug

When styling with Tailwind through theming, it is needed to type the passthrough options like so -> datatablePT: Pick<PrimeReactPTOptions, "datatable">

When trying to access the context for a bodyRow in passthrough options for DataTable the type for context is DataTableContext and not DataTableBodyRowContext.

bodyRow({ context }) -> context is type any
bodyRow(options) => options?.context is type DataTableContext

Reproducer

No response

System Information
System:
    OS: Windows 11 10.0.22631
    CPU: (12) x64 Intel(R) Core(TM) i7-10850H CPU @ 2.70GHz
    Memory: 18.29 GB / 31.85 GB
  Binaries:
    Node: 22.15.1 - C:\Program Files\nodejs\node.EXE
    Yarn: 4.9.2 - C:\Program Files\nodejs\yarn.CMD
    npm: 10.9.2 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Chrome: 143.0.7499.41
    Edge: Chromium (140.0.3485.54)
    Firefox: 122.0 - C:\Program Files\Mozilla Firefox\firefox.exe
    Internet Explorer: 11.0.22621.3527
  npmPackages:
    primereact: ^10.9.7 => 10.9.7 
    react: ^19.1.1 => 19.1.1 
    tailwindcss: ^4.1.13 => 4.1.13
Steps to reproduce the behavior
  1. Create a passthrough styling object for the DataTable component, used for theming and not directly on the component.
  2. Add the type for the DataTable component from import type { PrimeReactPTOptions } from "primereact/api"
  3. Type the passthrough styling object like Pick<PrimeReactPTOptions, "datatable">
  4. Create styling for bodyRow bodyRow(options)
  5. Check that the options.context exists and that the type is wrong -> DataTableContext
Expected behavior

I would expect that the type for context in bodyRow is DataTableBodyRowContext and not the parent context type.

Ngôn ngữ chính
CSS
Star
8.3k
Fork
1.2k
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

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 primefaces/primereact

Tất cả issue của primefaces/primereact

Issue tương tự

Thêm issue về Web Dev

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.