[bugfix] Correct postUpdateAction handling in slider component.
- Fixed bug where postUpdateAction was not properly passed as a prop to the slider component - Prevented infinite re-renders by removing postUpdateAction from the dependency array
This commit is contained in:
@@ -252,7 +252,7 @@ export const useSliderLogic = ({
|
|||||||
if (postUpdateAction) {
|
if (postUpdateAction) {
|
||||||
postUpdateAction();
|
postUpdateAction();
|
||||||
}
|
}
|
||||||
}, [current_value.data, postUpdateAction]);
|
}, [current_value.data]);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
ui_value,
|
ui_value,
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ export const Slider = (props) => {
|
|||||||
} = useSliderLogic({
|
} = useSliderLogic({
|
||||||
current_value: props.current_value,
|
current_value: props.current_value,
|
||||||
setterFunction: props.setterFunction,
|
setterFunction: props.setterFunction,
|
||||||
|
postUpdateAction: props.postUpdateAction,
|
||||||
min: props.min,
|
min: props.min,
|
||||||
max: props.max,
|
max: props.max,
|
||||||
step: props.step,
|
step: props.step,
|
||||||
|
|||||||
Reference in New Issue
Block a user