const MyComponent = () => {
return <div style="color: blue;" class="some-thing" attr:id="another-thing">
Hello world!
</div>
}
const my_green_component = <MyComponent style="color: green;" attr:id="a-different-thing" />
// this will create:
// <div style="color: green;" id="a-different-thing" class="some-thing">Hello World!</div>
Generated using TypeDoc
when declaring a mutation to the element's member (not an attribute, but rather something that is accessible via the dot property accessor, such as
element.classList), use theset:prefix to specify what value to set it to.examples:
set:classList,set:style(this is different from the style-attribute), andset:parentNode(I don't think this one will work).common values for the
QualifiedMemberNamestype parameter:value,valueAsNumberandvalueAsDate)note that using a union of string literal attributes instead of just using any arbitrary string attribute, will lead to slowdowns in you IDE.