In this lesson, we’ll focus on managing component state using EdgeJS and how we can pass state from EdgeJS into AlpineJS.
EdgeJS State
The easiest way that we can set state within an EdgeJS Component is via the set tag (@set
). The set tag is going to allow us to set a local variable that will only exist inside of this particular component.
When defined at the top of our component file, it’ll be unique to its particular component instance and won’t be shared with other components or pages.
When defined inside a block, like an @each
or @if
, it’ll exist only inside that block. Similar to a tradition JavaScript variable.
Join The Discussion! (0 Comments)
Please sign in or sign up for free to join in on the dicussion.
Be the first to Comment!