I have a simple state where each property of the object should have a min-max value of 0 - 100. Aka volume between 0-100, etc. Right now if I decrease the volume, it goes negative. Where could I set a minimum value for this?
const [controls, setControls] = useState({
volume: 0,
bass: 0,
mid: 0,
treble: 0,
});
const volumeDecrease = () => {
setControls({
volume: controls.volume - 1,
});
};