Skip to content

Commit 488fd1a

Browse files
authored
fix: react defaultProps warning (#913)
* fix: react defaultProps warning * fix: getExpandableProps no default values
1 parent d3f1517 commit 488fd1a

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

src/Table.tsx

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,14 @@ export interface TableProps<RecordType = unknown>
171171
sticky?: boolean | TableSticky;
172172
}
173173

174-
function Table<RecordType extends DefaultRecordType>(props: TableProps<RecordType>) {
174+
function Table<RecordType extends DefaultRecordType>(tableProps: TableProps<RecordType>) {
175+
const props = {
176+
rowKey: 'key',
177+
prefixCls: 'rc-table',
178+
emptyText: () => 'No Data',
179+
...tableProps,
180+
};
181+
175182
const {
176183
prefixCls,
177184
className,
@@ -889,10 +896,4 @@ Table.ColumnGroup = ColumnGroup;
889896

890897
Table.Summary = FooterComponents;
891898

892-
Table.defaultProps = {
893-
rowKey: 'key',
894-
prefixCls: 'rc-table',
895-
emptyText: () => 'No Data',
896-
};
897-
898899
export default Table;

0 commit comments

Comments
 (0)