Is it possible to embed a wasm compose web composa...
# compose-web
l
Is it possible to embed a wasm compose web composable or a compose canvas into an existing JS application. We cannot migrate all ui to compose at one and want to start to move some parts to compose and use them in the existing JS application. Our business logic is already Kotlin common code and we already have some UI in compose multiplatform for other platforms.
a
Yes, it's possible. You can find an example here: https://github.com/JSMonk/make-friends-with-kotlin-devs/tree/step-4-share-components If you have any question related to the example, please ping me
l
@Artem Kobzar thanks for the example, but I'm looking for wasm version of compose multiplatform and not the JS target
a
There should be no difference for this example. In Wasm you can also export functions that render @Composable functions
m
Will it be same if I want to do this in a React project as well? I mean if I have some state in react and want to share with the the component in CMP will that still work?
@Leon Kiefer Were you able to get anywhere with this?
l
No I didn't have time to do a deep dive on this. We also need this for React.
For React native we created https://github.com/voize-gmbh/reakt-native-toolkit to integrate Kotlin Multiplatform into React native, with support for compose
m
That is great, thank you. I'm trying to figure out "sharing state" for react but no luck so far 🙁