I have Slider for range change in my react application. On value change of that slider, page is getting crashed. Following error is showing in chrome :
The following page(s) have become unresponsive. You can wait for them to become responsive or kill them.
Short code overview : React code handler for Slider (MUI) :
const handleRangeChange = useCallback(
(sensorConfiguration) => {
setSensorConfigurations({
...sensorConfigurations,
...sensorConfiguration,
});
onChange({
target: {
name: name,
value: { ...sensorConfigurations, ...sensorConfiguration },
},
});
},
[sensorConfigurations, name, onChange]
const handleTemperatureChange = useCallback(
(value) => {
handleRangeChange({ TEMPERATURE: value });
},
[handleRangeChange]
);
return (
<SensorRange
range={sensorConfigurations.TEMPERATURE}
min={DEFAULT_SENSOR_RANGES.TEMPERATURE.min}
max={DEFAULT_SENSOR_RANGES.TEMPERATURE.max}
indicators={DEFAULT_SENSOR_RANGES.TEMPERATURE.indicators}
onChange={handleTemperatureChange}
/>;
)
Via Active questions tagged javascript - Stack Overflow https://ift.tt/2FdjaAW
Comments
Post a Comment