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
table pagination position typescript type is wrong, document is Array, such as ['bottomRight'] #24409
Comments
Hello @vmwell. Please provide a online reproduction by forking this link https://u.ant.design/codesandbox-repro or a minimal GitHub repository. Issues labeled by 你好 @vmwell, 我们需要你提供一个在线的重现实例以便于我们帮你排查问题。你可以通过点击 此处 创建一个 codesandbox 或者提供一个最小化的 GitHub 仓库。7 天内未跟进的 issue 将会被自动关闭。 |
@ant-design-bot I know, but open the webpage too slow, no vpn |
You can choose to provide a minimal GitHub repository. |
@afc163 GitHub repository: https://github.com/vmwell/antd-demo Table define in App.tsx file |
- position: ["bottomLeft"]
+ position: ["bottomLeft" as "bottomLeft"] You can try this as workaround now. |
it is ok, thanks. |
It's not a antd bug. Typescript will tread as position: ["bottomLeft" as const] Or you can just reuse pagination define: const pagination: TableProps<any>['pagination'] = {
position: ['bottomLeft'],
};
const table = <Table pagination={pagination} />; |
Reproduction link
https://ant.design/components/table-cn/
Steps to reproduce
const pagination = {
position: ['bottomLeft']
}
let locale = getTableLocale(fetchStatus)
return (
<Table loading={loading} columns={columns} dataSource={dataSources.content}
pagination={pagination} rowKey={record => record.id} size="middle" bordered locale={locale} />
)
What is expected?
typescript project does not report the error
What is actually happening?
error : 不能将类型“string[]”分配给类型“TablePaginationPosition[]”。
The text was updated successfully, but these errors were encountered: