Gutenberg – Custom blocks onClick not working?
The Block Editor’s save() function doesn’t save JS functions to the database to be run on the front end. To run JS on the front end, you need to save it as a separate file and enqueue that file explicitly on the front end. With that in mind, it would be easiest to rewrite your … Read more