fix: Tabs、table2 warning 问题修复 (#6072)

* fix: Tabs warning 问题修复

* fix: table2 warning 问题修复
This commit is contained in:
sansiro 2023-01-30 21:04:01 +08:00 committed by GitHub
parent 74796dd258
commit c6675b1bc7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 7 deletions

View File

@ -244,9 +244,8 @@ export class Tabs extends React.Component<TabsProps, any> {
activeKey: this.props.activeKey, activeKey: this.props.activeKey,
children: Array.isArray(this.props.children) children: Array.isArray(this.props.children)
? this.props.children!.map(item => ({ ? this.props.children!.map(item => ({
key: item?.props.key, eventKey: item?.props?.eventKey,
eventKey: item?.props.eventKey, title: item?.props?.title
label: item?.props.label
})) }))
: this.props.children : this.props.children
}, },
@ -254,9 +253,8 @@ export class Tabs extends React.Component<TabsProps, any> {
activeKey: preProps.activeKey, activeKey: preProps.activeKey,
children: Array.isArray(preProps.children) children: Array.isArray(preProps.children)
? preProps.children!.map((item: any) => ({ ? preProps.children!.map((item: any) => ({
key: item?.props.key, eventKey: item?.props?.eventKey,
eventKey: item?.props.eventKey, title: item?.props?.title
label: item?.props.label
})) }))
: preProps.children : preProps.children
} }

View File

@ -1050,7 +1050,7 @@ export class Table extends React.PureComponent<TableProps, TableState> {
<HeadCellSort <HeadCellSort
column={item} column={item}
active={ active={
this.state.sort?.orderBy && !!this.state.sort?.orderBy &&
this.state.sort.orderBy === item?.name this.state.sort.orderBy === item?.name
} }
onSort={(payload: SortProps) => { onSort={(payload: SortProps) => {