Browse Source

So far wasmReady is not composable so I'm skipping this

with_mpp_example
Shagen Ogandzhanian 3 years ago
parent
commit
d70d7e87b1
  1. 12
      web/core/src/jsMain/kotlin/org/jetbrains/compose/skiko/skiko.kt

12
web/core/src/jsMain/kotlin/org/jetbrains/compose/skiko/skiko.kt

@ -8,16 +8,12 @@ package org.jetbrains.compose.web.skiko
import androidx.compose.runtime.Composable
import androidx.compose.ui.window.ComposeCanvas
import org.jetbrains.compose.web.dom.ElementScope
import org.jetbrains.skiko.wasm.onWasmReady
import org.w3c.dom.HTMLCanvasElement
@Composable
fun ElementScope<HTMLCanvasElement>.skiko(block: @Composable () -> Unit) {
// onWasmReady {
DomSideEffect { canvas ->
ComposeCanvas(canvas).apply {
setContent(block)
}
}
// }
DomSideEffect { canvas ->
val skikoCanvas = ComposeCanvas(canvas)
skikoCanvas.setContent(block)
}
}
Loading…
Cancel
Save