Fix editable-card Tabs children map bug, close #2658

This commit is contained in:
afc163
2016-08-11 16:36:12 +08:00
parent f2bb52e57b
commit 42298b60d4
+2 -2
View File
@@ -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}