Checks WP version before adopting blockProps
This commit is contained in:
parent
0d94a1d576
commit
2ba05d95f7
|
@ -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 });
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Reference in New Issue