File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -211,7 +211,7 @@ const SliderComponent = (
211
211
...localProps
212
212
} = props ;
213
213
const [ currentValue , setCurrentValue ] = useState (
214
- props . value ?? props . minimumValue ,
214
+ props . value || props . minimumValue || constants . SLIDER_DEFAULT_INITIAL_VALUE ,
215
215
) ;
216
216
const [ width , setWidth ] = useState ( 0 ) ;
217
217
@@ -338,7 +338,7 @@ const SliderComponent = (
338
338
const SliderWithRef = React . forwardRef ( SliderComponent ) ;
339
339
340
340
SliderWithRef . defaultProps = {
341
- value : 0 ,
341
+ value : constants . SLIDER_DEFAULT_INITIAL_VALUE ,
342
342
minimumValue : 0 ,
343
343
maximumValue : 1 ,
344
344
step : 0 ,
Original file line number Diff line number Diff line change 1
1
export const constants = {
2
+ SLIDER_DEFAULT_INITIAL_VALUE : 0 ,
2
3
MARGIN_HORIZONTAL_PADDING : 0.05 ,
3
4
STEP_NUMBER_TEXT_FONT_SMALL : 8 ,
4
5
STEP_NUMBER_TEXT_FONT_BIG : 12 ,
You can’t perform that action at this time.
0 commit comments