Skip to content

Commit

Permalink
Fix error in the Counter block (#2372)
Browse files Browse the repository at this point in the history
- Error fixed
  • Loading branch information
mardelnet authored Sep 9, 2024
1 parent c2bf18c commit ec201e3
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions assets/src/blocks/Counter/CounterScript.js
Original file line number Diff line number Diff line change
@@ -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);
Expand Down

0 comments on commit ec201e3

Please sign in to comment.