i tried to loop and execute a component inside react, but giving error. Map function is used when we have an array, but here i have a number and i want to execute a component 4 number of times.
Error it was giving is : "Parsing error: Unexpected token (61:23)"
<div>
(
for (var i=0; i <4; i++) {
<StarIcon />
}
)
</div>
2
Answers
There is a better way to display your stars 🙂