Alpine.js x-on shorthand breaks WordPress blocks

When I try to create a WordPress block using the @ syntax for x-on: in Alpine.js I notice that the block’s JavaScript file gets angry.

image

Replacing the shorthand with the longer x-on: directive works fine, though.
image

I’m just throwing this out there in case @matjaz decides to change the way Pinegrow parses our HTML or in case other people run into the same issues and don’t feel like banging their heads against the wall.

3 Likes

@adamslowe I think that React doesn’t like the @. Use x-on instead.

4 Likes

Makes sense. And yes, it works fine with x-on.

1 Like