Cleaned up hooks

This commit is contained in:
Jay
2025-08-06 18:42:25 -04:00
parent 2f2c8d173e
commit f47d46f382
5 changed files with 31 additions and 38 deletions
+5 -2
View File
@@ -57,7 +57,7 @@ export function useSlider({
// Internal position management
const [position, setPosition] = useState(0);
const positionRef = useRef(0);
const positionRef = useRef(position);
useEffect(() => {
directionRef.current = direction;
@@ -68,8 +68,11 @@ export function useSlider({
dimensions.x,
dimensions.y,
);
}, [direction, origin, dimensions]);
useEffect(() => {
valueRangeRef.current = valueRange;
}, [direction, origin, dimensions, valueRangeRef]);
}, [valueRangeRef]);
useEffect(() => {
setValueRef.current = setValue;