Skip to content

Commit

Permalink
Merge branch 'trunk' into try/summary-coupon-remove-block-registration
Browse files Browse the repository at this point in the history
  • Loading branch information
cbravobernal authored Aug 11, 2022
2 parents 1c18a86 + dcb05be commit 3e0f77c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions assets/js/base/utils/bhe-frontend.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* External dependencies
*/
import { ReactElement } from 'react';
import { unmountComponentAtNode } from 'react-dom';

/**
* Internal dependencies
Expand Down Expand Up @@ -150,6 +151,10 @@ class WpBlock extends HTMLElement {
);
} );
}
disconnectedCallback() {
// Unmount the React component, running callbacks and cleaning up its state.
unmountComponentAtNode( this );
}
}

// We need to wrap the element registration code in a conditional for the same
Expand Down

0 comments on commit 3e0f77c

Please sign in to comment.