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.
Replacing the shorthand with the longer x-on: directive works fine, though.
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
matjaz
January 18, 2023, 4:30pm
2
@adamslowe I think that React doesn’t like the @. Use x-on instead.
opened 08:10PM - 26 Feb 20 UTC
closed 05:14PM - 29 Feb 20 UTC
Alpine looks great but is it possible for me to use AlpineJS template _inside_ o… f React, rather than replacing React? It would be really helpful if I can use Alpine for simple toggle, etc. states and React for everything else.
Is this possible? Thanks!
4 Likes
Makes sense. And yes, it works fine with x-on.
1 Like