Alpine.js
x-ignore
By default, Alpine will crawl and initialize the entire DOM tree of an element containing x-init or x-data.
If for some reason, you don't want Alpine to touch a specific section of your HTML, you can prevent it from doing so using x-ignore.
<div x-data="{ label: 'From Alpine' }">
<div x-ignore>
<span x-text="label"></span>
</div>
</div>
In the above example, the
<span>tag will not contain "From Alpine" because we told Alpine to ignore the contents of thedivcompletely.
x-effect
x-effect is a useful directive for re-evaluating an expression when one of its dependencies change. It is very similar to useEffect hook in React.
x-ref
x-ref in combination with $refs (covered in magics) is a useful utility for easily accessing DOM elements directly. It's most useful as a replacement for APIs like getElementById and querySelector.
