rn-range-slider
Advanced tools
Comparing version 2.1.0 to 2.1.1
@@ -10,3 +10,2 @@ import React, { memo, useState, useEffect, useCallback, useMemo, useRef } from 'react'; | ||
const trueFunc = () => true; | ||
const noop = () => {}; | ||
@@ -66,3 +65,3 @@ const Slider = ( | ||
updateSelectedRail(); | ||
onValueChanged(low, high, false); | ||
onValueChanged?.(low, high, false); | ||
}, [disableRange, inPropsRef, max, min, onValueChanged, thumbWidth, updateSelectedRail]); | ||
@@ -157,3 +156,3 @@ | ||
(isLow ? lowThumbX : highThumbX).setValue(absolutePosition); | ||
onValueChanged(isLow ? value : low, isLow ? high : value, true); | ||
onValueChanged?.(isLow ? value : low, isLow ? high : value, true); | ||
(isLow ? setLow : setHigh)(value); | ||
@@ -212,2 +211,3 @@ labelUpdate && labelUpdate(gestureStateRef.current.lastPosition, value); | ||
max: PropTypes.number.isRequired, | ||
minRange: PropTypes.number, | ||
step: PropTypes.number.isRequired, | ||
@@ -226,2 +226,4 @@ renderThumb: PropTypes.func.isRequired, | ||
onValueChanged: PropTypes.func, | ||
onTouchStart: PropTypes.func, | ||
onTouchEnd: PropTypes.func, | ||
}; | ||
@@ -235,5 +237,4 @@ | ||
floatingLabel: false, | ||
onValueChanged: noop, | ||
}; | ||
export default memo(Slider); |
{ | ||
"name": "rn-range-slider", | ||
"version": "2.1.0", | ||
"version": "2.1.1", | ||
"author": "Tigran Sahakyan <mail.of.tigran@gmail.com>", | ||
@@ -5,0 +5,0 @@ "description": "A highly optimized pure JS implementation of Range Slider for React Native", |
23429
404