Hi, the documentation here says to use the kotlin...
# compose-web
m
Hi, the documentation here says to use the kotlin code annotated by @JsExport in JavaScript I have to import this
.mjs
module. I am not sure where this is generated I have tried a bunch of gradle tasks and all they create are these files. Any help is very much appreciated please. thank you.
My primary goal is to get the WASM working in react web app.
a
@Mohammed Akram Hussain 'to get the wasm working in react web' wdym by this? are u trying to get ur compose app to work inside of a react web app or some kotlin function to work in ur react app?
m
Yeah get a composeable working inside the react app while having its (composeable's) state in the react.
a
compose web is a canvas app. have a look at that index.html file in your screenshot and you will see how things are wired. you can make a react component that loads the scripts u find in index.html and that way u can display ur compose web app within react
having the state in react and controlling the compose app via react will be tricky. u will need to be creative to achieve this
m
okay, I was hoping "having the state in react and controlling the compose app via react" will be similar to kotlin/js?
Also I am very confused with the documentation stating to use
.mjs
file while it doesn't seems to generate that.
a
the documentation you are looking at is not about compose web. it's about kotlin js. not sure what gradle task u need to run to get that mjs file. what do u think u need that mjs file for?