in html/integration-core/src/jsMain/kotlin/androidx/compose/web/sample/Sample.kt [344:377]
fun smallColoredText(text: String) {
if (globalInt.value < 5) {
Div(
attrs = {
if (globalInt.value > 2) {
id("someId-${globalInt.value}")
}
classes("someClass")
attr("customAttr", "customValue")
onClick {
globalInt.value = globalInt.value + 1
}
ref { element ->
println("DIV CREATED ${element.id}")
onDispose { println("DIV REMOVED ${element.id}") }
}
style {
if (globalState.isDarkTheme) {
color(Color.black)
} else {
color(Color.green)
}
}
},
) {
Text("Text = $text")
}
}
}