From 45db4cab504468cdc893ead66eeb6a903c79aa5f Mon Sep 17 00:00:00 2001 From: afc163 Date: Fri, 8 Jul 2016 17:17:57 +0800 Subject: [PATCH] improve props passing --- components/badge/index.jsx | 14 +++++++++----- components/transfer/list.jsx | 15 +++------------ 2 files changed, 12 insertions(+), 17 deletions(-) diff --git a/components/badge/index.jsx b/components/badge/index.jsx index e3662f8581..e29dd9e6f9 100644 --- a/components/badge/index.jsx +++ b/components/badge/index.jsx @@ -21,7 +21,7 @@ export default class Badge extends React.Component { } render() { - let { count, prefixCls, overflowCount, className, style, children, dot, ...restProps } = this.props; + let { count, prefixCls, overflowCount, className, style, children, dot } = this.props; count = count > overflowCount ? `${overflowCount}+` : count; @@ -40,17 +40,21 @@ export default class Badge extends React.Component { }); return ( - + {children} - { hidden ? null : - } diff --git a/components/transfer/list.jsx b/components/transfer/list.jsx index 69cecbd214..6bbf4c29d4 100644 --- a/components/transfer/list.jsx +++ b/components/transfer/list.jsx @@ -4,7 +4,6 @@ import Search from './search'; import classNames from 'classnames'; import Animate from 'rc-animate'; import PureRenderMixin from 'react-addons-pure-render-mixin'; -import omit from 'object.omit'; function noop() { } @@ -118,17 +117,9 @@ export default class TransferList extends React.Component { render() { const { prefixCls, dataSource, titleText, filter, checkedKeys, - checkStatus, body, footer, showSearch, render, ...otherProps } = this.props; + checkStatus, body, footer, showSearch, render, style } = this.props; - let { searchPlaceholder, notFoundContent, ...restProps } = otherProps; - - // fix https://fb.me/react-unknown-prop - const lastProps = omit(restProps, [ - 'handleClear', - 'handleFilter', - 'handleSelect', - 'handleSelectAll', - ]); + let { searchPlaceholder, notFoundContent } = this.props; // Custom Layout const footerDom = footer({ ...this.props }); @@ -177,7 +168,7 @@ export default class TransferList extends React.Component { } return ( -
+
{this.renderCheckbox({ prefixCls: 'ant-transfer',