This commit is contained in:
Seghir Nadir 2020-08-18 12:32:40 +01:00 committed by GitHub
parent fad8c06b23
commit 28d3bd7dda
1 changed files with 2 additions and 11 deletions

View File

@ -43,13 +43,6 @@ const renderBlockInContainers = ( {
return;
}
// @todo Remove Suspense compatibility fix once WP 5.2 is no longer supported.
// If Suspense is not available (WP 5.2), use a noop component instead.
const noopComponent = ( { children } ) => {
return <>{ children }</>;
};
const SuspenseComponent = Suspense || noopComponent;
// Use Array.forEach for IE11 compatibility.
Array.prototype.forEach.call( containers, ( el, i ) => {
const props = getProps( el, i );
@ -62,11 +55,9 @@ const renderBlockInContainers = ( {
render(
<BlockErrorBoundary { ...errorBoundaryProps }>
<SuspenseComponent
fallback={ <div className="wc-block-placeholder" /> }
>
<Suspense fallback={ <div className="wc-block-placeholder" /> }>
<Block { ...props } attributes={ attributes } />
</SuspenseComponent>
</Suspense>
</BlockErrorBoundary>,
el
);