replace synchronizeBlocksWithTemplate with createBlocksFromInnerBlocksTemplate (https://github.com/woocommerce/woocommerce-blocks/pull/5040)

This commit is contained in:
Seghir Nadir 2021-11-22 13:45:48 +01:00 committed by GitHub
parent 128ef97010
commit d345a0004a
1 changed files with 2 additions and 3 deletions

View File

@ -13,7 +13,7 @@ import {
getBlockType,
Block,
AttributeSource,
synchronizeBlocksWithTemplate,
createBlocksFromInnerBlocksTemplate,
TemplateArray,
} from '@wordpress/blocks';
import { isEqual } from 'lodash';
@ -91,8 +91,7 @@ export const useForcedLayout = ( {
innerBlocks.length === 0 &&
currentDefaultTemplate.current.length > 0
) {
const nextBlocks = synchronizeBlocksWithTemplate(
innerBlocks,
const nextBlocks = createBlocksFromInnerBlocksTemplate(
currentDefaultTemplate.current
);
if ( ! isEqual( nextBlocks, innerBlocks ) ) {