From 42298b60d4437ab94ce81472bf64f2a0e8926e06 Mon Sep 17 00:00:00 2001 From: afc163 Date: Thu, 11 Aug 2016 16:36:12 +0800 Subject: [PATCH] Fix editable-card Tabs children map bug, close #2658 --- components/tabs/index.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/tabs/index.jsx b/components/tabs/index.jsx index 7ee6c9dc4..be2e4eace 100644 --- a/components/tabs/index.jsx +++ b/components/tabs/index.jsx @@ -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:
{child.props.tab}