remove suspense polyfill (https://github.com/woocommerce/woocommerce-blocks/pull/3015)
This commit is contained in:
parent
fad8c06b23
commit
28d3bd7dda
|
@ -43,13 +43,6 @@ const renderBlockInContainers = ( {
|
||||||
return;
|
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.
|
// Use Array.forEach for IE11 compatibility.
|
||||||
Array.prototype.forEach.call( containers, ( el, i ) => {
|
Array.prototype.forEach.call( containers, ( el, i ) => {
|
||||||
const props = getProps( el, i );
|
const props = getProps( el, i );
|
||||||
|
@ -62,11 +55,9 @@ const renderBlockInContainers = ( {
|
||||||
|
|
||||||
render(
|
render(
|
||||||
<BlockErrorBoundary { ...errorBoundaryProps }>
|
<BlockErrorBoundary { ...errorBoundaryProps }>
|
||||||
<SuspenseComponent
|
<Suspense fallback={ <div className="wc-block-placeholder" /> }>
|
||||||
fallback={ <div className="wc-block-placeholder" /> }
|
|
||||||
>
|
|
||||||
<Block { ...props } attributes={ attributes } />
|
<Block { ...props } attributes={ attributes } />
|
||||||
</SuspenseComponent>
|
</Suspense>
|
||||||
</BlockErrorBoundary>,
|
</BlockErrorBoundary>,
|
||||||
el
|
el
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue