import React, { useState } from 'react';
const ShowBoxComponent = () => {
const [clickCount, setClickCount] = useState(0);
const [showBox, setShowBox] = useState(false);
const handleClick = () => {
const newClickCount = clickCount + 1;
if (newClickCount === 3) {
setShowBox(true);
}
setClickCount(newClickCount);
};
return (
<div>
<button onClick={handleClick}>Click Me</button>
{showBox && <p className="namasaya">The box shows after 3 clicks</p>}
<p>Click Count: {clickCount}</p>
</div>
);
};
export default ShowBoxComponent;