Skip to content

Commit 612c26c

Browse files
authored
update thumbStyle when tintColor changes (#3211)
1 parent 8207456 commit 612c26c

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/incubator/Slider/index.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -270,11 +270,9 @@ const Slider = React.memo((props: Props) => {
270270
}, [value, setInitialPositions]);
271271

272272
useEffect(() => {
273-
if (!thumbStyle) {
274-
_thumbStyle.value = StyleUtils.unpackStyle(defaultThumbStyle, {flatten: true});
275-
}
273+
_thumbStyle.value = StyleUtils.unpackStyle(thumbStyle ? customThumbStyle : defaultThumbStyle, {flatten: true});
276274
// eslint-disable-next-line react-hooks/exhaustive-deps
277-
}, [defaultThumbStyle, thumbStyle]);
275+
}, [defaultThumbStyle, customThumbStyle, thumbStyle]);
278276

279277
const onValueChangeThrottled = useCallback(_.throttle(value => {
280278
if (!didValueUpdate.current) { // NOTE: don't invoke onValueChange when slider's value prop updated programmatically

0 commit comments

Comments
 (0)