I'm trying to migrate to the latest version of kot...
# react
m
I'm trying to migrate to the latest version of kotlin-react which doesn't use
kotlinx.html
, and I'm currently inserting a custom HTML element in the following way:
Copy code
class MyCustomElement(consumer: TagConsumer<*>) :
    HTMLTag("my-custom-element", consumer, emptyMap(), inlineTag = true, emptyTag = true), HtmlInlineTag

inline fun RBuilder.myCustomElement(block: RDOMBuilder<MyCustomElement>.() -> Unit): ReactElement =
    tag(block) { MyCustomElement(it) }

// How to use:
myCustomElement {
    attrs {
        id = "my-custom-element-id"
    }
}
How can I achieve the same thing without
kotlinx.html
? Thanks!
1
t
Copy code
external interface MyCustomElementProps: HTMLAttributes<HtmlElement>

val MyCustomElement = IntrinsicType<MyCustomElementProps>("my-custom-element-id")

// inside component
val App = FC {
    MyCustomElement {
        id = "my-custom-element-id"
    }
}
cc @Sergei Grishchenko @Sebastian Aigner
m
thank you!