Here’s my code so far -
const [isEmpty, setIsEmpty] = useState(true);
let arr = [];
const addInterviewers = (value, isAdded) => {
if (isAdded === 'ADD') {
arr.push(value);
} else {
const index = arr.indexOf(value);
arr.splice(index, 1)
}
enableButton();
console.log(isEmpty);
console.log(arr);
}
const enableButton = () => {
if (arr.length === 0) {
setIsEmpty(true);
} else {
setIsEmpty(false);
}
}
<button
className={
isEmpty
? "Interviewers-button"
: "Interviewers-button-enabled"
}
>
Next   <FontAwesomeIcon icon="chevron-right"/>
</button>
The problem is, enableButton function is interfering with array ‘arr’ values. Because of enableButton, arr removes the first element and starts with second element.
Sorry for bad explanation. I hope it makes sense.