import * as React from 'react' ; import RcSlider from 'rc-slider' ; import { SliderPropsType } from './interface' ; import { omit } from '../utils' ; import './style' ; const defaultProps = { prefixCls : 'cp-ui-slider' } ; const omitProps = ( props ) => { const excludeProps = [ 'prefixCls' ] ; return omit ( props , excludeProps ) ; } ; const Slider = props => { const { prefixCls } = props ; const otherProps = omitProps ( props ) ; console . log ( otherProps ) ; return ( < div className = { `${ prefixCls }` } > < RcSlider { ... otherProps } / > < /div>); } ; Slider . defaultProps = defaultProps ; export default Slider ;