diff --git a/.changeset/gentle-donkeys-rule.md b/.changeset/gentle-donkeys-rule.md new file mode 100644 index 0000000000..eb33cfce12 --- /dev/null +++ b/.changeset/gentle-donkeys-rule.md @@ -0,0 +1,5 @@ +--- +'@astrojs/renderer-lit': patch +--- + +renderer-lit will bind to properties rather than attributes fixing certain binding issues diff --git a/packages/astro/test/fixtures/lit-element/src/components/my-element.js b/packages/astro/test/fixtures/lit-element/src/components/my-element.js index 7b7eed71ce..6466bca024 100644 --- a/packages/astro/test/fixtures/lit-element/src/components/my-element.js +++ b/packages/astro/test/fixtures/lit-element/src/components/my-element.js @@ -3,9 +3,26 @@ import { LitElement, html } from 'lit'; export const tagName = 'my-element'; export class MyElement extends LitElement { + static properties = { + bool: {type: Boolean}, + str: {type: String, attribute: 'str-attr'}, + obj: {type: Object}, + } + + constructor() { + super(); + this.bool = true; + this.str = 'not initialized'; + this.obj = {data: null}; + // not a reactive property + this.foo = 'not initialized'; + } render() { return html`