Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add readonly modifier for antd table columns type #31888

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion components/table/__tests__/type.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ describe('Table.typescript types', () => {
name: string;
}

const columns: ColumnProps<User>[] = [
const columns: readonly ColumnProps<User>[] = [
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a new type test case instead updating old one.

{
title: 'Name',
dataIndex: 'name',
Expand Down
2 changes: 1 addition & 1 deletion components/table/interface.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export interface ColumnGroupType<RecordType> extends Omit<ColumnType<RecordType>
children: ColumnsType<RecordType>;
}

export type ColumnsType<RecordType = unknown> = (
export type ColumnsType<RecordType = unknown> = readonly (
| ColumnGroupType<RecordType>
| ColumnType<RecordType>
)[];
Expand Down