How to call AlertComponent in alert notificaion in my React JS code?

const Services = () => {
  const [num, setNum] = useState(0);


  const incNum = () => {
    setNum(num + 1);
  };

  const decNum = () => {
    if (num > 0) {
      setNum(num - 1)
    }
    else {
      alert(<AlertComponent/>);
      setNum(0);
    }
  }

As it is working like alert("Congrats")
why not is working alert(<AlertComponent/>)
How to do that please guide