react-component / react-component/table

More precise ColumnType

Open
#499 1 comment 6 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
1.4k
Forks
618
Avg merge
10h 19m
Merged PRs (30d)
2

Description

Column type doesn't check the coherence between dataIndex and render value type. It should be changed to something like:

export interface ColumnType<RecordType, IndexType extends keyof RecordType> extends ColumnSharedType<RecordType> {
  colSpan?: number;
  dataIndex?: IndexType;
  render?: (
    value: **RecordType[IndexType]**,
    record: RecordType,
    index: number,
  ) => React.ReactNode | RenderedCell<RecordType>;
...
}

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the ColumnType definition and any existing type tests; the issue names no file or test entry point. Compare the current dataIndex and render typings with the proposed interface, then verify that the render value type is coherent with the selected record field without breaking existing usage.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.