Skip to content

Commit

Permalink
Use props in render method, don't pass as arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
sirreal committed Aug 14, 2018
1 parent deba47a commit e40788f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions client/my-sites/checklist/main.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,9 @@ class ChecklistMain extends PureComponent {
}
}

renderHeader( completed, displayMode ) {
const { translate, isNewlyCreatedSite } = this.props;
renderHeader() {
const { displayMode, isNewlyCreatedSite, tasks, translate } = this.props;
const completed = tasks && ! some( tasks, { completed: false } );

if ( completed ) {
return (
Expand Down Expand Up @@ -147,8 +148,7 @@ class ChecklistMain extends PureComponent {
}

render() {
const { checklistAvailable, displayMode, siteId, tasks, translate } = this.props;
const completed = tasks && ! some( tasks, { completed: false } );
const { checklistAvailable, displayMode, siteId, translate } = this.props;

let translatedTitle = translate( 'Site Checklist' );
let title = 'Site Checklist';
Expand All @@ -167,7 +167,7 @@ class ChecklistMain extends PureComponent {
{ checklistAvailable ? (
<Fragment>
{ siteId && <QuerySiteChecklist siteId={ siteId } /> }
{ this.renderHeader( completed, displayMode ) }
{ this.renderHeader() }
<ChecklistShow />
</Fragment>
) : (
Expand Down

0 comments on commit e40788f

Please sign in to comment.