import { useState } from "react"; function MyComponent(){ const [disabled, setDisabled] = useState(false); return ( <button disabled={disabled} onClick={setDisabled}>Click to Disable</button> ) }