Answers for "loop number in react"

15

loop inside react js

<div>
  {items.map((item,index) => <ObjectRow key={index} name={item} />)} 
</div>
Posted by: Guest on July-27-2021
0

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
Posted by: Guest on May-24-2021
0

react loop

{data.map(x => {
  return (
    <div>
      <p>{content}</p>
    </div>
  )
})}
Posted by: Guest on August-06-2021
0

loop number in react

let App = () => {
  return <ul>{Array.from(Array(10), (e, i) => {
    return <li key={i}>{i}</li>
  })}</ul>
}
Posted by: Guest on December-19-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language