I want to write a simple program where using for loop it will print numbers from 0 to 10. I am trying to use a for loop which will print numbers from 0 to 10 and will pass the props to child component. Here is my code:
import React, { Component } from 'react';
class App extends Component {
render() {
return(
<div>
<p>
{
for(var i=0;i<11;i++)
{
// var data=i;
<Print value={i}/>
}
}
</p>
</div>
);
}
}
const Print=(props)=>{
return(
<div>
{props.value}
</div>
);
}
export default App;