Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to render first three element using map

// ...inside the render() function

var size = 3;
var items = list.slice(0, size).map(i => {
    return <myview item={i} key={i.id} />
}

return (
  <div>
    {items}
  </div>   
)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #render #element #map
ADD COMMENT
Topic
Name
5+3 =