-
-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Block preview issue while using Alpine.js in Gutenberg #74
Comments
Alpine and React don't play nice together in the backend. If you get it working I'm interested. |
Yeah, thought there may be a conflict. I'll have a deeper dig to see if I can find out more, and maybe test with Vue too. Will keep you posted. |
I think JSX is the troublemaker - see this article: https://codewithhugo.com/alpine-js-react/ So, can disable it via on block:
But not sure what knock on effect that might have 🧐 |
It'd prevent the use of |
Suppose its a bit of a trade-off, with using Alpine or Inner Blocks - can't imagine using both together, so this method is a viable workaround. |
I would rather use the <div class="{{ $block->classes }}">
<div @if (!$block->preview) x-data="{ count: 1 }" @endif>
<p @if (!$block->preview) x-text="count" @endif></p>
<button x-on:click="count++">Count Up</button>
<button x-on:click="count--">Count Down</button>
</div>
<div>
<InnerBlocks />
</div>
</div> |
Brandon do you know if there is an issue with using Alpine.js within blocks? I've just added a simple alpine code block to an acf composer block view file eg:
It no longer allows the block to preview in Gutenberg?
The text was updated successfully, but these errors were encountered: