mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-24 11:10:01 +08:00
chore: adjust parameter order (#41036)
This commit is contained in:
parent
39c645bbb7
commit
d7378a09ba
@ -400,17 +400,20 @@ function InternalTable<RecordType extends object = any>(
|
||||
]);
|
||||
|
||||
// ========================== Selections ==========================
|
||||
const [transformSelectionColumns, selectedKeySet] = useSelection<RecordType>(rowSelection, {
|
||||
prefixCls,
|
||||
data: mergedData,
|
||||
pageData,
|
||||
getRowKey,
|
||||
getRecordByKey,
|
||||
expandType,
|
||||
childrenColumnName,
|
||||
locale: tableLocale,
|
||||
getPopupContainer: getPopupContainer || getContextPopupContainer,
|
||||
});
|
||||
const [transformSelectionColumns, selectedKeySet] = useSelection<RecordType>(
|
||||
{
|
||||
prefixCls,
|
||||
data: mergedData,
|
||||
pageData,
|
||||
getRowKey,
|
||||
getRecordByKey,
|
||||
expandType,
|
||||
childrenColumnName,
|
||||
locale: tableLocale,
|
||||
getPopupContainer: getPopupContainer || getContextPopupContainer,
|
||||
},
|
||||
rowSelection,
|
||||
);
|
||||
|
||||
const internalRowClassName = (record: RecordType, index: number, indent: number) => {
|
||||
let mergedRowClassName: string;
|
||||
|
@ -68,10 +68,10 @@ function flattenData<RecordType>(childrenColumnName: string, data?: RecordType[]
|
||||
return list;
|
||||
}
|
||||
|
||||
export default function useSelection<RecordType>(
|
||||
rowSelection: TableRowSelection<RecordType> | undefined,
|
||||
function useSelection<RecordType>(
|
||||
config: UseSelectionConfig<RecordType>,
|
||||
): [TransformColumns<RecordType>, Set<Key>] {
|
||||
rowSelection?: TableRowSelection<RecordType>,
|
||||
): readonly [TransformColumns<RecordType>, Set<Key>] {
|
||||
const {
|
||||
preserveSelectedRowKeys,
|
||||
selectedRowKeys,
|
||||
@ -716,5 +716,7 @@ export default function useSelection<RecordType>(
|
||||
],
|
||||
);
|
||||
|
||||
return [transformColumns, derivedSelectedKeySet];
|
||||
return [transformColumns, derivedSelectedKeySet] as const;
|
||||
}
|
||||
|
||||
export default useSelection;
|
||||
|
Loading…
Reference in New Issue
Block a user