`aggregatedCell` not typed against bound `cellComponents` in `createAppColumnHelper`
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 78/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- react, typescript
- Área
- frontend
Línea de trabajo
Empieza en packages/react-table/src/createTableHook.tsx, especialmente en AppColumnDefBase y en el tipo ColumnDef_RowAggregation de rowAggregationFeature, y luego reproduce la discrepancia en el TypeScript playground enlazado. Verifica que aggregatedCell reciba la misma tipificación del componente de celda enlazado que cell, y añade o ejecuta una prueba de comprobación de tipos específica si el repositorio proporciona una.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- TypeScript
- Estrellas
- 28.4k
- Forks
- 3.6k
- Merge medio
- 1 d 1 h
- PR fusionados (30 d)
- 7
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de TanStack/table
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 78/100
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
-
Dificultad 3/5 1-2 días Aptitud para principiantes 55/100
-
Dificultad 3/5 1-2 días Aptitud para principiantes 48/100
Todos los issues de TanStack/table
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
bcgov/bc-wallet-mobile#4761 · 1 comentario ·
-
external-issue to-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
-
area-deployment area-integrations triage:bot-seen
Dificultad 2/5 Medio día Aptitud para principiantes 86/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
-
refactor
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100