@@ -5,6 +5,7 @@ import type { TableProps as RcTableProps } from 'rc-table/lib/Table';
5
5
import { INTERNAL_HOOKS } from 'rc-table/lib/Table' ;
6
6
import omit from 'rc-util/lib/omit' ;
7
7
import * as React from 'react' ;
8
+ import type { ConfigConsumerProps } from '../config-provider/context' ;
8
9
import { ConfigContext } from '../config-provider/context' ;
9
10
import defaultRenderEmpty from '../config-provider/defaultRenderEmpty' ;
10
11
import type { SizeType } from '../config-provider/SizeContext' ;
@@ -169,19 +170,21 @@ function InternalTable<RecordType extends object = any>(
169
170
) ;
170
171
} , [ baseColumns , screens ] ) ;
171
172
172
- const tableProps = omit ( props , [ 'className' , 'style' , 'columns' ] ) as TableProps < RecordType > ;
173
+ const tableProps : TableProps < RecordType > = omit ( props , [ 'className' , 'style' , 'columns' ] ) ;
174
+
175
+ const size = React . useContext < SizeType > ( SizeContext ) ;
173
176
174
- const size = React . useContext ( SizeContext ) ;
175
177
const {
176
178
locale : contextLocale = defaultLocale ,
177
- renderEmpty,
178
179
direction,
179
- } = React . useContext ( ConfigContext ) ;
180
+ renderEmpty,
181
+ getPrefixCls,
182
+ } = React . useContext < ConfigConsumerProps > ( ConfigContext ) ;
183
+
180
184
const mergedSize = customizeSize || size ;
181
- const tableLocale = { ...contextLocale . Table , ...locale } as TableLocale ;
185
+ const tableLocale : TableLocale = { ...contextLocale . Table , ...locale } ;
182
186
const rawData : readonly RecordType [ ] = dataSource || EMPTY_LIST ;
183
187
184
- const { getPrefixCls } = React . useContext ( ConfigContext ) ;
185
188
const prefixCls = getPrefixCls ( 'table' , customizePrefixCls ) ;
186
189
const dropdownPrefixCls = getPrefixCls ( 'dropdown' , customizeDropdownPrefixCls ) ;
187
190
0 commit comments