Hello! How to insert text with HTML tags into `RCo...
# javascript
a
Hello! How to insert text with HTML tags into
RComponent
(
RBuilder
)? Details in thread.
Copy code
override fun RBuilder.render() {
    styledDiv {
        +"String with <b>HTML</b> tags" //  not work
    }
}
t
Your can use
kotlinx.html
DSL
Something like this:
Copy code
override fun RBuilder.render() {
    styledDiv {
        + "String with "
        b("HTML")
        + " tags"
    }
}
a
@turansky sorry for my mistake. Little bit wrong example. Next for understand better what I want.
Copy code
val loadedHtmlText: String = "Uknown html text"

override fun RBuilder.render() {
    styledDiv {
        +loadedHtmlText //  not work
    }
}
t
Works as expected 🙂
dangerouslySetInnerHTML already declared in wrappers
👍 1