fix: Transfer throw error whentitles is undefined (#38182)

Co-authored-by: tangwenhui <tangwenhui@rd.netease.com>
This commit is contained in:
kiner-tang(文辉) 2022-10-23 16:06:50 +08:00 committed by GitHub
parent 072fda0f15
commit 2a1f2836f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -398,7 +398,7 @@ class Transfer<RecordType extends TransferItem = TransferItem> extends React.Com
<div className={cls} style={style}>
<List<KeyWise<RecordType>>
prefixCls={`${prefixCls}-list`}
titleText={titles[0]}
titleText={titles?.[0]}
dataSource={leftDataSource}
filterOption={filterOption}
style={this.handleListStyle(listStyle, 'left')}
@ -434,7 +434,7 @@ class Transfer<RecordType extends TransferItem = TransferItem> extends React.Com
/>
<List<KeyWise<RecordType>>
prefixCls={`${prefixCls}-list`}
titleText={titles[1]}
titleText={titles?.[1]}
dataSource={rightDataSource}
filterOption={filterOption}
style={this.handleListStyle(listStyle, 'right')}