@@ -7,7 +7,6 @@ import {useThumbFollower, useLowHigh, useWidthLayout, useLabelContainerProps, us
77import { clamp , getValueForPosition , isLowCloser } from './helpers' ;
88
99const trueFunc = ( ) => true ;
10- const noop = ( ) => { } ;
1110
1211const Slider = (
1312 {
@@ -62,7 +61,7 @@ const Slider = (
6261 const lowPosition = ( low - min ) / ( max - min ) * ( containerWidth - thumbWidth ) ;
6362 lowThumbX . setValue ( lowPosition ) ;
6463 updateSelectedRail ( ) ;
65- onValueChanged ( low , high , false ) ;
64+ onValueChanged ?. ( low , high , false ) ;
6665 } , [ disableRange , inPropsRef , max , min , onValueChanged , thumbWidth , updateSelectedRail ] ) ;
6766
6867 useEffect ( ( ) => {
@@ -152,7 +151,7 @@ const Slider = (
152151 gestureStateRef . current . lastValue = value ;
153152 gestureStateRef . current . lastPosition = absolutePosition + thumbWidth / 2 ;
154153 ( isLow ? lowThumbX : highThumbX ) . setValue ( absolutePosition ) ;
155- onValueChanged ( isLow ? value : low , isLow ? high : value , true ) ;
154+ onValueChanged ?. ( isLow ? value : low , isLow ? high : value , true ) ;
156155 ( isLow ? setLow : setHigh ) ( value ) ;
157156 labelUpdate && labelUpdate ( gestureStateRef . current . lastPosition , value ) ;
158157 notchUpdate && notchUpdate ( gestureStateRef . current . lastPosition , value ) ;
@@ -206,6 +205,7 @@ Slider.propTypes = {
206205 ...ViewPropTypes ,
207206 min : PropTypes . number . isRequired ,
208207 max : PropTypes . number . isRequired ,
208+ minRange : PropTypes . number ,
209209 step : PropTypes . number . isRequired ,
210210 renderThumb : PropTypes . func . isRequired ,
211211 low : PropTypes . number ,
@@ -219,6 +219,8 @@ Slider.propTypes = {
219219 renderRail : PropTypes . func . isRequired ,
220220 renderRailSelected : PropTypes . func . isRequired ,
221221 onValueChanged : PropTypes . func ,
222+ onTouchStart : PropTypes . func ,
223+ onTouchEnd : PropTypes . func ,
222224} ;
223225
224226Slider . defaultProps = {
@@ -227,7 +229,6 @@ Slider.defaultProps = {
227229 disableRange : false ,
228230 disabled : false ,
229231 floatingLabel : false ,
230- onValueChanged : noop ,
231232} ;
232233
233234export default memo ( Slider ) ;
0 commit comments