I am working with Material UI and React for the first time doing an exercise and I cannot enable a button once clicked a second time after it was disabled.
here is the code:
const [hello, setHello] = useState(true)
<Button variant='contained' color='primary' disabled={hello ? false : true} onClick={() => setHello(!hello)}>
Click Me
</Button>
When the page starts the button is enabled
and when I click for the first time it becomes disabled as it should
The problem is that it stays disabled when clicked again. Shouldn't setHello(!hello) change hello into its opposite boolean value?

