Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Use of map in react

const todoItems = [
  {
    id: 1,
    text:"todo 1"
  },
  {
    id: 2,
    text:"todo 3"
  },
  {
    id: 3,
    text:"todo 3"
  }
];
const todoItems = todos.map((todo) =>
  <li key={todo.id}>
    {todo.text}
  </li>
);
Source by reactjs.org #
 
PREVIOUS NEXT
Tagged: #Use #map #react
ADD COMMENT
Topic
Name
1+9 =