The condition inside the loop does not seem to be called or is not functioning:
let events = eventData.map(( timelineEvent ) => {
let directions;
if (timelineEvent % 2 == 0) {
directions = "direction-r";
} else {
directions = "direction-l"
}
return (
<TimelineEvent
type = {timelineEvent.type}
time = {timelineEvent.time}
title = {timelineEvent.title}
place = {timelineEvent.place}
location = {timelineEvent.location}
description = {timelineEvent.description}
direction = {directions}>
<div>gallery</div>
<TimelineEditButton
deleteClick={timelineEvent.id}
dataId={ timelineEvent.id}
editClick={this.openPartial.bind(this, "editEventPartial")} />
</TimelineEvent>
);
});
The data renders but for some reason the condition does not seem to have any affect. Any help? Thanks
