11/* eslint-disable react/no-unknown-property */
22import * as React from 'react' ;
3- import cls from 'classnames ' ;
3+ import { clsx } from 'clsx ' ;
44import raf from '@rc-component/util/lib/raf' ;
55import SemanticContext from './SemanticContext' ;
66
@@ -22,6 +22,7 @@ export interface StepHandlerProps {
2222 downDisabled ?: boolean ;
2323 onStep : ( up : boolean , emitter : 'handler' | 'keyboard' | 'wheel' ) => void ;
2424}
25+
2526export default function StepHandler ( {
2627 prefixCls,
2728 upNode,
@@ -64,18 +65,20 @@ export default function StepHandler({
6465 React . useEffect (
6566 ( ) => ( ) => {
6667 onStopStep ( ) ;
67- frameIds . current . forEach ( ( id ) => raf . cancel ( id ) ) ;
68+ frameIds . current . forEach ( ( id ) => {
69+ raf . cancel ( id ) ;
70+ } ) ;
6871 } ,
6972 [ ] ,
7073 ) ;
7174
7275 // ======================= Render =======================
7376 const handlerClassName = `${ prefixCls } -handler` ;
7477
75- const upClassName = cls ( handlerClassName , `${ handlerClassName } -up` , {
78+ const upClassName = clsx ( handlerClassName , `${ handlerClassName } -up` , {
7679 [ `${ handlerClassName } -up-disabled` ] : upDisabled ,
7780 } ) ;
78- const downClassName = cls ( handlerClassName , `${ handlerClassName } -down` , {
81+ const downClassName = clsx ( handlerClassName , `${ handlerClassName } -down` , {
7982 [ `${ handlerClassName } -down-disabled` ] : downDisabled ,
8083 } ) ;
8184
@@ -94,7 +97,7 @@ export default function StepHandler({
9497 } ;
9598
9699 return (
97- < div className = { cls ( `${ handlerClassName } -wrap` , classNames ?. actions ) } style = { styles ?. actions } >
100+ < div className = { clsx ( `${ handlerClassName } -wrap` , classNames ?. actions ) } style = { styles ?. actions } >
98101 < span
99102 { ...sharedHandlerProps }
100103 onMouseDown = { ( e ) => {
0 commit comments