You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
1010 B
25 lines
1010 B
2 years ago
|
### Use Compose HTML Library in React app
|
||
3 years ago
|
|
||
|
[see ComposeInReactApp.kt](src/jsMain/kotlin/ComposeInReactApp.kt)
|
||
|
|
||
|
`useCompose(...)` is a custom React effect to render a content using Compose.
|
||
|
It's not a part of any library.
|
||
|
|
||
2 years ago
|
### Use React in Compose HTML Library
|
||
3 years ago
|
|
||
|
`UseReactEffect(...)` is a custom Compose effect to render a content using React.
|
||
|
It's not a part of any library.
|
||
|
|
||
|
[see ReactInComposeApp.kt](src/jsMain/kotlin/ReactInComposeApp.kt)
|
||
|
|
||
|
### How to use existing React components:
|
||
|
|
||
|
It requires adding `external` declarations. For example: [ReactYoutubePlayer.kt](src/jsMain/kotlin/ReactYoutubePlayer.kt)
|
||
|
|
||
|
Here is a good tutorial - [Using packages from NPM](https://play.kotlinlang.org/hands-on/Building%20Web%20Applications%20with%20React%20and%20Kotlin%20JS/07_Using_Packages_From_NPM)
|
||
|
|
||
|
### Running web application
|
||
2 years ago
|
* To run, launch command: `./gradlew :jsBrowserRun`
|
||
|
* Or choose **browser** configuration in IDE and run it.
|
||
2 years ago
|
![browser-run-configuration.png](screenshots/browser-run-configuration.png)
|