Is it possible to integrate a React web applicatio...
# compose
m
Is it possible to integrate a React web application with Compose Multiplatform using WASM while maintaining shared state management between both frameworks?
c
I don't think so. React web is described by html and js, while compose is described by kotlin.
m
yeah but you can do the introp between the two using Kotlin multiplatform: https://kotlinlang.org/docs/wasm-js-interop.html
c
yes, but compose renders to a
<canvas>
and React manipulates the DOM.
@calidion
compose is described by kotlin
in the end its still js/wasm
m
I'm mostly confused on sharing the state between the two. Like how will CMP get the state from the react app? are there any examples / samples?
c
export a function in Kotlin to set the compose state. not sure how you will propagate the state then in compose runtime but should work somehow. https://kotlinlang.org/docs/wasm-js-interop.html#use-kotlin-code-in-javascript
m
Okay, I'll do some R&D and see how it goes
c
interesting, but i am struggling using compose with android now.😀