Answers for "adding list items in react"

2

adding list items in react

const numbers = [1, 2, 3, 4, 5];
const listItems = numbers.map((number) =>  <li>{number}</li>);
                              
ReactDOM.render(
  <ul>{listItems}</ul>, document.getElementById('root')
);
Posted by: Guest on June-28-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language