From 6341b9484f59ea2dc26218c26af82cd677cb2f20 Mon Sep 17 00:00:00 2001 From: Dan BROOKS Date: Mon, 7 Nov 2016 21:51:11 -0800 Subject: [PATCH] fix(lint): Use function since no state --- plugins/album/views/home.jsx | 17 +++-------------- plugins/album/views/thumb.jsx | 15 ++------------- 2 files changed, 5 insertions(+), 27 deletions(-) diff --git a/plugins/album/views/home.jsx b/plugins/album/views/home.jsx index 75448bf8b..aed4c5422 100644 --- a/plugins/album/views/home.jsx +++ b/plugins/album/views/home.jsx @@ -2,21 +2,10 @@ const React = require('react'); const Thumb = require('./thumb.jsx'); -class Album extends React.Component { - constructor(props) { - super(props); +function Album({ album }) { + const thumbs = album.item.map(item => ); - // Set up initial state - this.state = { - items: props.album.item, - }; - } - - render() { - const thumbs = this.state.items.map(item => ); - - return
    {thumbs}
; - } + return
    {thumbs}
; } Album.propTypes = { diff --git a/plugins/album/views/thumb.jsx b/plugins/album/views/thumb.jsx index 66d81430c..951d0fc43 100644 --- a/plugins/album/views/thumb.jsx +++ b/plugins/album/views/thumb.jsx @@ -1,18 +1,7 @@ const React = require('react'); -class Thumb extends React.Component { - constructor(props) { - super(props); - - // Set up initial state - this.state = { - item: props.item, - }; - } - - render() { - return
  • {this.state.item.filename[0]}
  • ; - } +function Thumb({ item }) { + return
  • {item.filename[0]}
  • ; } Thumb.propTypes = {