Skip to content

Commit

Permalink
Add onDeleteBlock to the extra data to re-render when it has changes (#…
Browse files Browse the repository at this point in the history
…22716)

* add renderFooterAppender to the extraData to re-render list

* small refactor

* Add onDeleteBlock to the extra data to re-render when it has changes

* add renderFooterAppender to the extraData to re-render list

* small refactor

* Add onDeleteBlock to the extra data to re-render when it has changes
  • Loading branch information
dratwas committed May 29, 2020
1 parent d3ad37b commit 55c3d44
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export class BlockList extends Component {
this.extraData = {
parentWidth: this.props.parentWidth,
renderFooterAppender: this.props.renderFooterAppender,
onDeleteBlock: this.props.onDeleteBlock,
};
this.renderItem = this.renderItem.bind( this );
this.renderBlockListFooter = this.renderBlockListFooter.bind( this );
Expand Down Expand Up @@ -107,14 +108,16 @@ export class BlockList extends Component {
}

getExtraData() {
const { parentWidth, renderFooterAppender } = this.props;
const { parentWidth, renderFooterAppender, onDeleteBlock } = this.props;
if (
this.extraData.parentWidth !== parentWidth ||
this.extraData.renderFooterAppender !== renderFooterAppender
this.extraData.renderFooterAppender !== renderFooterAppender ||
this.extraData.onDeleteBlock !== onDeleteBlock
) {
this.extraData = {
parentWidth,
renderFooterAppender,
onDeleteBlock,
};
}
return this.extraData;
Expand Down

0 comments on commit 55c3d44

Please sign in to comment.