From the sandbox, the issue occurs because you're setting the state back to the prop value instead of toggling it.
So, update your state using the new value instead:
const newValue = !enabled;
setEnabled(newValue); // instead of doing setEnabled(value)