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

`aggregatedCell` not typed against bound `cellComponents` in `createAppColumnHelper`

Đang mở
#6,583 0 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 1 ngày

@cpruijsen đang làm issue này rồi.

Từ ngày 11/9/2026.

  • #6584 của @nirmal-shaji — đã đóng, không merge
  • #6589 của @cpruijsen — đang mở

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

Hướng nghiên cứu

Bắt đầu trong packages/react-table/src/createTableHook.tsx, đặc biệt là AppColumnDefBase và kiểu ColumnDef_RowAggregation của rowAggregationFeature, sau đó tái hiện sự không khớp trong TypeScript playground được liên kết. Xác minh rằng aggregatedCell nhận được cùng kiểu thành phần ô đã được liên kết như cell, đồng thời thêm hoặc chạy một bài kiểm tra kiểm tra kiểu tập trung nếu repository cung cấp bài kiểm tra đó.

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

Mô tả

TanStack Table version

v9.2.4

Framework/Library version

React v19.2.6

Describe the bug and the steps to reproduce it

createTableHook's AppColumnDefBase enhances cell/header/footer with the
registered cellComponents/headerComponents, via:

Omit<IdentifiedColumnDef<...>, 'cell' | 'header' | 'footer'> & { cell?: ..., header?: ..., footer?: ... }

aggregatedCell (added by rowAggregationFeature's ColumnDef_RowAggregation) is not
included in that Omit list, so it stays typed against the plain, unenhanced CellContext.
Accessing a bound cell component works fine inside cell on a column, but fails inside
aggregatedCell on the exact same column.

Steps to reproduce:

  1. Register a cellComponents map via createTableHook (e.g. { NumberCell }).
  2. Create a column with both cell and aggregatedCell, each destructuring cell and
    accessing cell.NumberCell.
  3. cell.NumberCell type-checks inside cell, but TypeScript reports
    "Property 'NumberCell' does not exist on type 'Cell<...>'" inside aggregatedCell.

Confirmed by reading packages/react-table/src/createTableHook.tsx directly (not just from
the compiled .d.ts) — AppColumnDefBase's Omit list is 'cell' | 'header' | 'footer' only.

Your Minimal, Reproducible Example - (Sandbox Highly Recommended)

https://www.typescriptlang.org/play/?#code/JYWwDg9gTgLgBAbwFBzgYygUwIY0wFWwCMAbTACQggGsAaFOGYsgMRxgFcsBne1KCAHcAggHNRWUbmAQAdm1xdMfdBBIcQsgOICOYYLNELOWFRnaYdEPZgAmAJSEBZCLcwkV2cZOlyWsgH0QHFkkAF84ADMBEDgAcgABJlluJjRqAHosbDQYAFomUkw4pCQYAE8wTDhHQTgAXkQ4CWswAC44VKgDUQBuOAA3bHVMDtkNIkwoODDSyI5ZXJlZOAA5CamAYXcSAAoASkQGLBMV8ZIScNK0OVSo9iVuBsZmTGNH3eR+ITEJTCkYMt3qYGDd1JorHoesDlAwWjYHM5XO4OuZcJZdFVEYIXG49vtPN5-r55CkOgg4MFsLIOl4-gCgYEqStZmF9tdbvAKWi8MIwGBNmoNLJyO4qtMIo0eQRXpQaJ8GJEHjwzDtBeA5JhZDBuOS1hsoNsLjNwuykDcUvAABZiqbPaV8gVCzSikjigA8tQAfAdSja3VMAHQ5NCYbjcaC7OJDEZxWhHVDAWwdaPDDjFVUXDqfdA7GaHepe3MXQPrECTQ07eMZDJwADyAGkGHSfIC-DT4sy482iQC7EaSNnuXm2Q0i6GS2WKwPTUggA

Screenshots or Videos (Optional)

No response

Do you intend to try to help solve this bug with your own PR?
export function createAppColumnHelper<TData extends RowData>() {
    const helper = createRawColumnHelper<TData>()

    function accessor<
        TAccessor extends AccessorFn<TData> | DeepKeys<TData>,
        TValue extends TAccessor extends AccessorFn<TData, infer TReturn>
            ? TReturn
            : TAccessor extends DeepKeys<TData>
              ? DeepValue<TData, TAccessor>
              : never
    >(
        accessorArg: TAccessor,
        column: Omit<
            AppColumnDefBase<typeof appFeatures, TData, TValue, CellComponents, HeaderComponents>,
            'aggregatedCell'
        > & {
            aggregatedCell?: AggregatedCellRender<TData, any>
        } & (TAccessor extends AccessorFn<TData> ? { id: string } : {})
    ): TAccessor extends AccessorFn<TData>
        ? AccessorFnColumnDef<typeof appFeatures, TData, TValue>
        : AccessorKeyColumnDef<typeof appFeatures, TData, TValue> {
        const { aggregatedCell, ...rest } = column

        return helper.accessor(
            accessorArg as never,
            {
                ...rest,
                ...(typeof aggregatedCell === 'function'
                    ? {
                          aggregatedCell: (ctx: CellContext<typeof appFeatures, TData, TValue>) =>
                              aggregatedCell(
                                  ctx as unknown as AppCellContext<
                                      typeof appFeatures,
                                      TData,
                                      any,
                                      CellComponents
                                  >
                              )
                      }
                    : { aggregatedCell })
            } as never
        ) as never
    }

    return { ...helper, accessor }
}
Terms & Code of Conduct
  • I agree to follow this project's Code of Conduct
  • I understand that if my bug cannot be reliable reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.
Ngôn ngữ chính
TypeScript
Star
28.5k
Fork
3.6k
Merge trung bình
19 giờ 40 phút
Pull request đã merge (30 ngày)
8

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 TanStack/table

Tất cả issue của TanStack/table

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.