I would like to ask how can I limit my .map
loop for example to a 5 items only because currently when I access an api it returns 20 items. but I want to display
You could use Array#slice and take only the elements you need.
var film = this.props.data.slice(0, 5).map((item) => {
return <FilmItem key={item.id} film={item} />
});
return film;
If you do not neet the original array anymore, you could mutate the array with seting length to 5
and iterate then.