`aggregatedCell` not typed against bound `cellComponents` in `createAppColumnHelper`
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 78/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- react, typescript
- 領域
- frontend
調査の方向性
packages/react-table/src/createTableHook.tsx から始め、特に AppColumnDefBase と rowAggregationFeature の ColumnDef_RowAggregation 型を確認し、その後、リンクされた TypeScript playground で不一致を再現します。aggregatedCell が cell と同じバインド済みセルコンポーネントの型を受け取ることを確認し、リポジトリに用意されている場合は、型チェックに特化したテストを追加または実行します。
索引モデルが issue の本文から書いたものです。
説明
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:
- Register a cellComponents map via createTableHook (e.g.
{ NumberCell }). - Create a column with both
cellandaggregatedCell, each destructuringcelland
accessingcell.NumberCell. cell.NumberCelltype-checks insidecell, but TypeScript reports
"Property 'NumberCell' does not exist on type 'Cell<...>'" insideaggregatedCell.
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)
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.
- 主要言語
- TypeScript
- スター
- 28.4k
- フォーク
- 3.6k
- 平均マージ
- 1日 1時間
- マージ済み PR(30日)
- 7
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
TanStack/table のほかの issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 48/100
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
bug v2
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
modelcontextprotocol/inspector#2458 · コメント 1 件 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 75/100
railmapgen/rmp-gallery#4068 ·
-
Mend: dependency security vulnerability status: needs triage 🕵️♀️
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
carbon-design-system/ibm-products#9907 ·