Skip to content

Commit bf09286

Browse files
committed
Optimize offset value update in Range component
1 parent 0f8d9be commit bf09286

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/components/Range.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export default function Range({ value, setValue, Left, Right, accent = Colors.ac
2020
useEffect(() => {
2121
const timer = setTimeout(() => {
2222
if (containerWidth > 0) offset.value = withTiming(containerWidth * value)
23-
}, 50)
23+
}, 0)
2424
return () => clearTimeout(timer)
2525
// eslint-disable-next-line react-hooks/exhaustive-deps
2626
}, [containerWidth])

0 commit comments

Comments
 (0)