You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The webc:type="js" examples in the docs don't work correctly atm, as the "js" type behaves differently to the old "render" type. If a prop is not passed to the component it throws when you try to access it. This means you can't even check if the prop exists 😅
<scriptwebc:type="js">
if (alt) {`<img src="${src}" alt="${alt}">`;} else {`<a href="${src}">Your image didn’t have an alt so you get this link instead.</a>`;}</script>
[11ty] ReferenceError: alt is not defined
[11ty] at evalmachine.<anonymous>:2:3
[11ty] at Script.runInContext (node:vm:141:12)
Doing the equivalent with this.alt in a webc:type="render" component works fine.
The text was updated successfully, but these errors were encountered:
The
webc:type="js"
examples in the docs don't work correctly atm, as the "js" type behaves differently to the old "render" type. If a prop is not passed to the component it throws when you try to access it. This means you can't even check if the prop exists 😅Doing the equivalent with
this.alt
in awebc:type="render"
component works fine.The text was updated successfully, but these errors were encountered: