Trying to update an objects state via the useState hook but it does not seem to be working. Just wondering if anyone can spot what I'm doing wrong here:
This is my useState:
const [selectState, setSelectState] = React.useState({
level1: 0,
level2: 0,
level3: 0,
});
Component where I'm trying to update State:
<Button
onClick={() => setSelectState({ ...selectState, level: 1 })}
selected={selectState === 1}
text="Blue"
/>