Replies: 1 comment
-
Hi @swpw, |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey,
During block render I generate random block id. How would i go around passing the id to scripts loaded by block.json.
In case of having the same multiple blocks on the page I want to enqueue script files each time the block is added to the page therefore each script within that block can read unique id of that block.
As of now i managed to pass id to block scripts using this:
But as far as it does pass the id to the scripts, It only works for the first block. Every next block doesn't load the script since it never gets enqueued as it's a duplicate. How could i go around this problem?
Beta Was this translation helpful? Give feedback.
All reactions