diff --git a/components/rate/index.tsx b/components/rate/index.tsx index 2c272a31c7..87184ea324 100644 --- a/components/rate/index.tsx +++ b/components/rate/index.tsx @@ -1,7 +1,6 @@ import * as React from 'react'; import RcRate from 'rc-rate'; import omit from 'omit.js'; -import classNames from 'classnames'; import StarFilled from '@ant-design/icons/StarFilled'; import Tooltip from '../tooltip'; @@ -54,13 +53,10 @@ export default class Rate extends React.Component { } renderRate = ({ getPrefixCls, direction }: ConfigConsumerProps) => { - const { prefixCls, className, ...restProps } = this.props; + const { prefixCls, ...restProps } = this.props; const rateProps = omit(restProps, ['tooltips']); const ratePrefixCls = getPrefixCls('rate', prefixCls); - const rateClassNames = classNames(className, { - [`${ratePrefixCls}-rtl`]: direction === 'rtl', - }); return ( { characterRender={this.characterRender} {...rateProps} prefixCls={ratePrefixCls} - className={rateClassNames} + direction={direction} /> ); }; diff --git a/components/rate/style/index.less b/components/rate/style/index.less index 17625a5b4f..43fba3a6f9 100644 --- a/components/rate/style/index.less +++ b/components/rate/style/index.less @@ -79,7 +79,7 @@ &-text { display: inline-block; - margin-left: 8px; + margin: 0 8px; font-size: @font-size-base; } } diff --git a/components/rate/style/rtl.less b/components/rate/style/rtl.less index f0678bc0ac..425ab11e4e 100644 --- a/components/rate/style/rtl.less +++ b/components/rate/style/rtl.less @@ -23,11 +23,4 @@ } } } - - &-text { - .@{rate-prefix-cls}-rtl & { - margin-right: 8px; - margin-left: 0; - } - } } diff --git a/package.json b/package.json index 5775292a3f..0c3ac33a17 100644 --- a/package.json +++ b/package.json @@ -122,7 +122,7 @@ "rc-pagination": "~2.2.0", "rc-picker": "~1.4.0", "rc-progress": "~2.5.0", - "rc-rate": "~2.5.1", + "rc-rate": "~2.6.0", "rc-resize-observer": "^0.2.0", "rc-select": "~10.2.0", "rc-slider": "~9.2.3",