Checks WP version before adopting blockProps

This commit is contained in:
mateuswetah 2021-08-20 11:56:38 -03:00
parent 0d94a1d576
commit 2ba05d95f7
2 changed files with 2 additions and 2 deletions

View File

@ -44,7 +44,7 @@ export default function({ attributes, setAttributes, className, isSelected, clie
} = attributes;
// Gets blocks props from hook
const blockProps = useBlockProps();
const blockProps = tainacan_blocks.wp_version < '5.6' ? { className: className } : useBlockProps();
// Obtains block's client id to render it on save function
setAttributes({ blockId: clientId });

View File

@ -25,7 +25,7 @@ export default function({ attributes, className }) {
} = attributes;
// Gets attributes such as style, that are automatically added by the editor hook
const blockProps = useBlockProps.save();
const blockProps = tainacan_blocks.wp_version < '5.6' ? { className: className } : useBlockProps.save();
return <div
{...blockProps}
data-module="facets-list"