Skip to content

Commit

Permalink
fix(lint): Use function since no state
Browse files Browse the repository at this point in the history
  • Loading branch information
danactive committed Nov 8, 2016
1 parent bc937da commit 6341b94
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 27 deletions.
17 changes: 3 additions & 14 deletions plugins/album/views/home.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 => <Thumb key={item.$.id} item={item} />);

// Set up initial state
this.state = {
items: props.album.item,
};
}

render() {
const thumbs = this.state.items.map(item => <Thumb key={item.$.id} item={item} />);

return <ul>{thumbs}</ul>;
}
return <ul>{thumbs}</ul>;
}

Album.propTypes = {
Expand Down
15 changes: 2 additions & 13 deletions plugins/album/views/thumb.jsx
Original file line number Diff line number Diff line change
@@ -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 <li>{this.state.item.filename[0]}</li>;
}
function Thumb({ item }) {
return <li>{item.filename[0]}</li>;
}

Thumb.propTypes = {
Expand Down

0 comments on commit 6341b94

Please sign in to comment.