Skip to content

Commit

Permalink
feat(example): Add SCU pattern to FeaturePage (react-boilerplate#1178)
Browse files Browse the repository at this point in the history
companion to react-boilerplate#811

the `FeaturePage` component class slipped through the cracks of react-boilerplate#811, since it used to be a functional component when it was opened... since this component is completely static, adds a `shouldComponentUpdate` that returns false and comment with explanation
  • Loading branch information
justingreenberg authored and mxstbr committed Nov 3, 2016
1 parent a6ea1de commit 1975097
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions app/containers/FeaturePage/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ import ListItem from './ListItem';
import ListItemTitle from './ListItemTitle';

export default class FeaturePage extends React.Component { // eslint-disable-line react/prefer-stateless-function

// Since state and props are static,
// there's no need to re-render this component
shouldComponentUpdate() {
return false;
}

render() {
return (
<div>
Expand Down

0 comments on commit 1975097

Please sign in to comment.