infinite loop in useEffect working with object

hello how can I stop loop? everything works well but its looping during the clicking,when selectedfightersqry equal to one. initially it is 0 and incrementing on click

const handleClick = (id, player) => {
    getFighterInfo(id);
    setSelectedPlayer(player);
    setSelectedFightersQty(selectedFightersQty + 1);
    setFightersData(selectedFightersData)
    
  };
  
useEffect(()=>{
  if(selectedFightersQty===1){
    setFightersData({
      ...selectedFightersData,
      playerOne:fighter
    })
  }else if(selectedFightersQty===2){
    setFightersData({
      ...selectedFightersData,
      playerTwo:fighter
    })
  }
 
},[selectedFightersQty, selectedFightersData])
How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum