Files
compose-multiplatform/examples/web-with-react
Igor Demin 7bd0b3d1a5 Fix examples, templates (#2359)
- move screenshot into screenshots folder
- add Readme, run configuration, .gitignore to web-template
- fix web-compose-in-js (read versions from properties)
- add global idea/ into gitignore
2022-10-05 13:44:37 +02:00
..
2022-10-04 02:51:59 +02:00
2022-10-03 01:56:58 +02:00
2021-05-25 18:45:50 +02:00
2022-10-05 13:44:37 +02:00

Use Compose(web) in React app

see ComposeInReactApp.kt

useCompose(...) is a custom React effect to render a content using Compose. It's not a part of any library.

Use React in Compose(web) app

UseReactEffect(...) is a custom Compose effect to render a content using React. It's not a part of any library.

see ReactInComposeApp.kt

How to use existing React components:

It requires adding external declarations. For example: ReactYoutubePlayer.kt

Here is a good tutorial - Using packages from NPM

Running web application

  • To run, launch command: ./gradlew :jsBrowserRun
  • Or choose browser configuration in IDE and run it.
    browser-run-configuration.png