mirror of
https://github.com/wahyd4/ant-design.git
synced 2026-08-25 12:45:52 +10:00
Fix editable-card Tabs children map bug, close #2658
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import RcTabs from 'rc-tabs';
|
||||
import React, { cloneElement } from 'react';
|
||||
import React, { cloneElement, Children } from 'react';
|
||||
import classNames from 'classnames';
|
||||
import Icon from '../icon';
|
||||
|
||||
@@ -47,7 +47,7 @@ export default class Tabs extends React.Component {
|
||||
// only card type tabs can be added and closed
|
||||
if (type === 'editable-card') {
|
||||
children = Array.isArray(children) ? children : [children];
|
||||
children = children.map((child, index) => {
|
||||
children = Children.map(children, (child, index) => {
|
||||
return cloneElement(child, {
|
||||
tab: <div>
|
||||
{child.props.tab}
|
||||
|
||||
Reference in New Issue
Block a user