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

in antd table column not allow to add align prop #48638

Closed
jeyakumar-BTR opened this issue Apr 25, 2024 · 2 comments
Closed

in antd table column not allow to add align prop #48638

jeyakumar-BTR opened this issue Apr 25, 2024 · 2 comments
Labels
🤔 Need Reproduce We cannot reproduce your problem unconfirmed

Comments

@jeyakumar-BTR
Copy link

Reproduction link

https://codepen.io/JoyeSara/pen/bGJZEPv?editors=0010

Steps to reproduce

import { Button, Table } from 'antd';
export const PayBillInvoicedRecordsList = () => {
const columns = [
{
title: 'Customer Name',
dataIndex: 'leaseCompanyName',
key: 'leaseCompanyName',
align: 'left',
render: (_: any, record: any) => ({
children:

{record.leaseCompanyName}
,
props: { rowSpan: record.isFirstElement ? rowSpan[record.enquiryNumber] : 0 },
}),
},
];

return (
<Table
columns={columns}
dataSource={flatten(data)}
rowKey={(record, index) => ${record.enquiryNumber}_${index}}
loading={isFetchingInvoicedRecords}
pagination={false}
bordered
/>
);
};

What is expected?

it should allow

What is actually happening?

 error:  Type '{ title: string; key: string; align: string; render: (_: any, record: any) => { children: JSX.Element; props: { rowSpan: number; }; }; dataIndex?: undefined; }' is not assignable to type 'ColumnType<{ isFirstElement: boolean; enquiryNumber: number; vatRate: string; lineTaxCode: { label: string; }; } | { isFirstElement: boolean; enquiryNumber: number; jobLineData: { lineTaxCode: { label: string; }; }[]; }>'.
    Types of property 'align' are incompatible.
      Type 'string' is not assignable to type 'AlignType | undefined'
Environment Info
antd 4.24.6
React 18.3.0
System Windows 11
Browser Google chrome
@afc163 afc163 added 🤔 Need Reproduce We cannot reproduce your problem and removed 🤔 Need Reproduce We cannot reproduce your problem labels Apr 26, 2024
@ant-design ant-design deleted a comment from github-actions bot Apr 26, 2024
@afc163 afc163 added the 🤔 Need Reproduce We cannot reproduce your problem label Apr 26, 2024
Copy link
Contributor

Hello @jeyakumar-BTR. Please provide a online reproduction by forking codesandbox of [email protected] or [email protected], or provide a minimal GitHub repository. Issues labeled by Need Reproduce will be closed if no activities in 3 days.

你好 @jeyakumar-BTR,我们需要你提供一个在线的重现实例以便于我们帮你排查问题。你可以通过点击这里创建一个 [email protected][email protected] 的 codesandbox,或者提供一个最小化的 GitHub 仓库。3 天内未跟进此 issue 将会被自动关闭。

什么是最小化重现,为什么这是必需的?

@afc163
Copy link
Member

afc163 commented Apr 26, 2024

I can't see TS error in your reproduce link.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤔 Need Reproduce We cannot reproduce your problem unconfirmed
Projects
None yet
Development

No branches or pull requests

2 participants