JSFiddle - React, Tailwind, and code Playground
JavaScript
case type.CLICK_AT_PLAYLIST_ITEM:
state.videos.map(video => {
if (video.id === action.id) {
state.playedVideo = video.src;
video.active = true
} else {
video.active = false
}
});
return Object.assign({}, state);