Reviews blocks: Fix warnings with components state (https://github.com/woocommerce/woocommerce-blocks/pull/908)

This commit is contained in:
Albert Juhé Lluveras 2019-08-27 11:38:28 +02:00 committed by GitHub
parent 3605ae580c
commit ce30a9f1ff
1 changed files with 7 additions and 1 deletions

View File

@ -17,7 +17,7 @@ const withReviews = ( OriginalComponent ) => {
this.state = {
error: null,
loading: false,
loading: true,
reviews: [],
totalReviews: 0,
};
@ -52,6 +52,12 @@ const withReviews = ( OriginalComponent ) => {
);
}
componentWillUnMount() {
if ( this.delayedAppendReviews.cancel ) {
this.delayedAppendReviews.cancel();
}
}
getArgs( reviewsToSkip ) {
const { categoryIds, order, orderby, productId, reviewsToDisplay } = this.props;
const args = {