Using Compose for HTML, is there a way to embed HT...
# compose-web
m
Using Compose for HTML, is there a way to embed HTML from a string?
b
You could access native dom element and use innerHtml prop via attrs.ref block
m
Unfortunately
ref
doesn't look like it'd work:
Copy code
The lambda that ref takes in is not Composable. It will be called only once when an element added into a composition. Likewise, the lambda passed in onDispose will be called only once when an element leaves the composition.
This means if the content is produced by a
produceState
, it will never be set to the new content when
produceState
updates.
b
There's also SideEffect.nativeElement
m
Hmm, I only see
Copy code
fun SideEffect(
    effect: () -> Unit
) {
    currentComposer.recordSideEffect(effect)
}
with no nativeElement specified anywhere. Where should I look?
b
Maybe it's in DisposableEffect afterall
It's defined as an extension prop on receiver
m
Hmm, it doesn't seem to be present in the HTML libraries at least
b
DisposableSideEffect then?
My bad