I'd like to get specific an array with onClick but the results always is undefined. if the explanation is unclear, tell me please. i will fix it ! Thanks here is the code
const chartType = ["Line", "Bar", "Pie", "Radar", "Doughnut", "Bubble"];
const getType = (e) => {
if (e.currentTarget === "Line") {
console.log("true");
}
};
const typeList = chartType.map((chart) => (
<div>
<h1 onClick={getType}>{chart}</h1>
</div>
));
u guys really helped me to solve this !! I appreciate it so much !! I hope u all have a really nice day !!