mapping only first item of array code example
Example: get the first value when mapping through the array
if (index === 0) {
return (
<h1 className="box_list_header"
onClick={this.handleBackToRoomList}
>{room.room_name}</h1>
)
}
if (index === 0) {
return (
<h1 className="box_list_header"
onClick={this.handleBackToRoomList}
>{room.room_name}</h1>
)
}