Type alias InlineMemberName<QualifiedMemberNames>

InlineMemberName<QualifiedMemberNames>: `set:${QualifiedMemberNames}`

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 the set: prefix to specify what value to set it to.
examples: set:classList, set:style (this is different from the style-attribute), and set:parentNode (I don't think this one will work).
common values for the QualifiedMemberNames type parameter:

  • for all common html element members: InlineMemberName<HTMLElementUniqueMemberKeys> (this is a tiny subset of what a specific element by support)
  • for a specific element's members: InlineMemberName<HTMLElementUniqueMemberKeys> (this one will now have unqie members such as value, valueAsNumber and valueAsDate)

note that using a union of string literal attributes instead of just using any arbitrary string attribute, will lead to slowdowns in you IDE.

Type Parameters

  • QualifiedMemberNames extends string = HTMLElementUniqueMemberKeys<any>

Example

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