I am trying to fetch data in React JSX code using For Loop.
const count = 10
return (
<>
{for(let i = 0; i < count; i++) {
return (
<div>
<h1>{i}</h1>
</div>
)
}}
</>
)
I know I can use the map function in JSX without using for loop. But I'd like to figure this out using a for loop. I think we can use a for loop to get it to work and I hope anyone here can help me.