Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Kotlin with JavaScript & React: A Reality
Search
Adora Nwodo
July 06, 2019
Programming
220
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Kotlin with JavaScript & React: A Reality
Adora Nwodo
July 06, 2019
More Decks by Adora Nwodo
See All by Adora Nwodo
Harnessing the Power of AI in Open-Source Cloud Engineering
adoranwodo
2
340
Getting Started With Data Structures
adoranwodo
1
490
StereoKit: The Open Source SDK for VR/MR
adoranwodo
0
210
Accessibility in the context of Mixed Reality
adoranwodo
0
100
Skills to Excel in Cloud Engineering
adoranwodo
0
470
The Opportunities In The Decade Of Mixed Realities
adoranwodo
0
120
7 Habits of Highly Effective Engineering Teams
adoranwodo
0
230
Designing secure cloud applications
adoranwodo
0
230
Building a sustainable personal brand
adoranwodo
0
170
Other Decks in Programming
See All in Programming
継続モナドとリアクティブプログラミング
yukikurage
3
500
AI時代の仕事技芸論〜ソフトウェア開発で「遊ぶように働く」職人的熟達のすすめ(スクフェス仙台 2026バージョン)
kuranuki
0
610
Claude Opus 4.6以後の受託開発エンジニアの変化(Claude Code開発ノウハウ大公開スペシャルbyクラスメソッド)
iidatakuma
1
590
OSINT for SRE: 学術論文とポストモーテムから探る システム障害の共通パターン / SRE NEXT 2026
tomoyk
1
3.5k
例外の正しい扱い方 そのエラー try-catchして大丈夫?
jinwatanabe
0
360
Performance Engineering for Everyone
elenatanasoiu
0
270
『コードを書く以外の』エンジニアリング〜課金基盤移行プロジェクト推進のためのTips4選
yuriko1211
0
380
Generative UI & AI-Assistants for Your Angular Solutions
manfredsteyer
PRO
0
100
トークンをケチるな、設計しろ:GitHub Copilotを賢く使うコンテキスト戦略
ochtum
0
310
symfony/aiとlaravel/boost
77web
0
120
1年で人数1.5倍、PR数5.5倍増。 品質とアウトカムはどうなったか、 何が効いたか
ike002jp
0
120
鹿野さんに聞く!『TypeScriptコードレシピ集』で磨く実践力
tonkotsuboy_com
4
1.1k
Featured
See All Featured
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
180
Making the Leap to Tech Lead
cromwellryan
135
10k
Faster Mobile Websites
deanohume
310
32k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
230
23k
[SF Ruby Conf 2025] Rails X
palkan
2
1.2k
The Curious Case for Waylosing
cassininazir
1
430
Building Flexible Design Systems
yeseniaperezcruz
330
40k
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
590
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
2k
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
Producing Creativity
orderedlist
PRO
348
40k
Transcript
KOTLIN WITH JAVASCRIPT & REACT: A REALITY
Hi, I’m Adora Software Engineer Creator, adorahack.com Co-organizer GDG Ajah,
Unstack, Android Ngr Twitter: @theadoranwodo YouTube: adorahack
KOTLIN ?
Kotlin is a cross-platform, statically typed, general-purpose programming language with
type inference.
WHY KOTLIN FOR JAVASCRIPT?
You’re not a fan of comparisons in Javascript '' ==
false 0 == false 0 === false null === undefined null == undefined null >= 0
Interoperability index.js function getToken(){ // do some stuff here //
return a token string } Main.kt val TOKEN = js("getToken()") as String
Kotlin is modern & easy to learn.
Share code between platforms
KOTLIN & REACT
Create React Kotlin App. npm install -g create-react-kotlin-app Kotlin React
Wrapper. npm i @jetbrains/kotlin-react
Lambdas are used in place of JSX when doing React
with Kotlin
const Message = ({ message}) => { if (message )
{ return ( <div>Hey, {message}</div> ); } return null } Functional Components - Message.js
fun RBuilder.alert(message: String = "") = if (message.isNotEmpty()) { div{
+ “Hey, $message” } } else { empty } Functional Components - Message.kt
• RComponent • RBuilder • RState • RProps • RActions
• rEnhancer Some things to remember
interface WelcomeProps: RProps { var name: String } class Welcome:
RComponent<WelcomeProps, RState>() { override fun RBuilder.render() { div { +"Hello, ${props.name}" } } } fun RBuilder.welcome(name: String = "John") = child(Welcome::class) { attrs.name = name } Class Components (Welcome.kt) Code snippet from https://github.com/JetBrains/kotlin-wrappers/tree/master/kotlin-react
Reusing Components Code snippet from https://github.com/JetBrains/kotlin-wrappers/tree/master/kotlin-react fun RBuilder.welcome(name: String =
"John") = child(Welcome::class) { attrs.name = name }
OTHER KOTLIN WEB WRAPPERS
kotlin-css & kotlin-styled DSL for creating stylesheets in Kotlin. npm
i @jetbrains/kotlin-css npm i @jetbrains/kotlin-css-js npm i @jetbrains/kotlin-styled
kotlin-mocha If you want to test, use this guy. npm
i @jetbrains/kotlin-mocha
kotlin-react-dom Kotlin wrapper for the React DOM library. npm i
@jetbrains/kotlin-react-dom
kotlin-react-redux Kotlin wrapper for the React Redux library. npm i
@jetbrains/kotlin-react-redux
kotlin-react-router-dom Kotlin wrapper for the React Router DOM library. npm
i @jetbrains/kotlin-react-router-dom
kotlin-redux Kotlin wrapper for the Redux library. npm i @jetbrains/kotlin-redux
• Introduction to Kotlin • Why Kotlin for JavaScript •
Kotlin in React • Existing Kotlin JS wrappers Summary
• https://kotlinlang.org/docs/reference/js-overview.html • https://github.com/JetBrains/kotlin-wrappers • https://github.com/JetBrains/create-react-kotlin-app • https://adorahack.com Helpful resources
Build for the web however you like!
THANKS! Website: adoranwodo.com Blog: adorahack.com Twitter: @adoranwodo