const [isActive, setIsActive] = useState(false);
const handleClick = (id) => {
setIsActive(id);
};
-
{globalFilter.map((data, index) => (
- handleClick(index)} > {data.text} ))}
this is my code, I am setting an active class while clicking one of the items and I want one first one should always be selected when I open this dialogue.