From ec201e3cbd7a766e8be08b5d6283f3e84895c068 Mon Sep 17 00:00:00 2001 From: Pedro Figueroa <59029273+mardelnet@users.noreply.github.com> Date: Mon, 9 Sep 2024 15:08:06 +0200 Subject: [PATCH] Fix error in the Counter block (#2372) - Error fixed --- assets/src/blocks/Counter/CounterScript.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/assets/src/blocks/Counter/CounterScript.js b/assets/src/blocks/Counter/CounterScript.js index 41d8da66df..43568f5015 100644 --- a/assets/src/blocks/Counter/CounterScript.js +++ b/assets/src/blocks/Counter/CounterScript.js @@ -1,12 +1,11 @@ import {CounterFrontend} from './CounterFrontend'; import {hydrateBlock} from '../../functions/hydrateBlock'; -import {BLOCK_NAME} from './CounterBlock'; import {createRoot} from 'react-dom/client'; -hydrateBlock(BLOCK_NAME, CounterFrontend); +hydrateBlock('planet4-blocks/counter', CounterFrontend); // Fallback for non migrated content. Remove after migration. -document.querySelectorAll(`[data-render="${BLOCK_NAME}"]`).forEach( +document.querySelectorAll('[data-render="planet4-blocks/counter"]').forEach( blockNode => { const attributes = JSON.parse(blockNode.dataset.attributes); const rootElement = createRoot(blockNode);