loop inside react js
<div>
{items.map((item,index) => <ObjectRow key={index} name={item} />)}
</div>
loop inside react js
<div>
{items.map((item,index) => <ObjectRow key={index} name={item} />)}
</div>
react native jsx loop with number
Count wiil be my number value = 10;
const {Count} = props;
let list = Count=== undefined?10:Count;
let jsx = [];
for (let index = 0; index < list; index++) {
jsx.push('index'+index)
}
return (
<View>
<Text>{jsx.length}</Text>
{jsx.map(()=>(
<Text>{index}</Text>
))
}
</View>
)
==========================
if you try like this
jsx = new Array(list);
this will create array but jsx is not working
try your self
react loop
{data.map(x => {
return (
<div>
<p>{content}</p>
</div>
)
})}
loop number in react
let App = () => {
return <ul>{Array.from(Array(10), (e, i) => {
return <li key={i}>{i}</li>
})}</ul>
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us