This repository hosts a number of Kotlin wrappers for popular JavaScript libraries.
To learn more please refer to the README
s of individual modules.
Artifacts are published to Maven Central, see the corresponding README files for package coordinates.
All packages require JDK 8 to be installed.
Use the "Kotlin Wrappers BOM" which helps to ensure consistency between the modules and allows you not to think about version compatibility.
Just declare kotlin-wrappers-bom
and specify the modules you need:
val kotlinWrappersVersion = "1.0.0-pre.733"
dependencies {
implementation(platform("org.jetbrains.kotlin-wrappers:kotlin-wrappers-bom:$kotlinWrappersVersion"))
implementation("org.jetbrains.kotlin-wrappers:kotlin-emotion")
implementation("org.jetbrains.kotlin-wrappers:kotlin-react")
implementation("org.jetbrains.kotlin-wrappers:kotlin-react-dom")
implementation("org.jetbrains.kotlin-wrappers:kotlin-tanstack-react-table")
// other wrappers
}
Or use a helper function:
fun kotlinw(target: String): String =
"org.jetbrains.kotlin-wrappers:kotlin-$target"
val kotlinWrappersVersion = "1.0.0-pre.733"
dependencies {
implementation(platform(kotlinw("wrappers-bom:$kotlinWrappersVersion")))
implementation(kotlinw("emotion"))
implementation(kotlinw("react"))
implementation(kotlinw("react-dom"))
implementation(kotlinw("tanstack-react-table"))
// other wrappers
}
Make sure that you have mavenCentral()
in the list of repositories.
-
A port of "Thinking in React" example
-
An example of using axios to fetch remote data. It also demonstrates how to add typings for an external library.
-
An example of using Quill that shows how to use an external React component.
-
An example of using react-router-dom that shows how to use react-route-dom with hooks API.
-
Building Web Applications with React and Kotlin/JS, a tutorial by JetBrains.
-
A full-stack demo application written in Kotlin for JetBrains Night Moscow 2019.
-
An example of using react-table that shows how to use react-table with hooks API.
-
ByteLegend: an open-source, real-world HTML5 MMORPG game.
Follow these examples to learn how to start developing your React apps with Kotlin. Good luck and have fun!
Contributions to this project are welcome! Please see the open issues or chat with us on the #react channel in our Slack.