# Calling Kotlin/React from javascript

**URL:** <https://discuss.kotlinlang.org/t/calling-kotlin-react-from-javascript/11464>\
**Category:** JavaScript\
**Created:** [February 6, 2019, 9:44am UTC](https://discuss.kotlinlang.org/t/calling-kotlin-react-from-javascript/11464 "2019-02-06T09:44:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![wal01](https://avatars.discourse-cdn.com/v4/letter/w/85e7bf/32.png) [@wal01](https://discuss.kotlinlang.org/u/wal01)\
**Post date:** [February 6, 2019, 9:44am UTC](https://discuss.kotlinlang.org/t/calling-kotlin-react-from-javascript/11464/1 "2019-02-06T09:44:45Z")

</div>

I’m trying to use Kotlin for building my React APP ([GitHub - JetBrains/create-react-kotlin-app: Create React apps using Kotlin with no build configuration](https://github.com/JetBrains/create-react-kotlin-app)). How can I call a function defined in the Kotlin class through the javascript function? How to set the module using create-react-kotlin-app?

---

<div class="post-metadata">

**Author:** ![mrtact](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/mrtact/32/4751_2.png) [@mrtact](https://discuss.kotlinlang.org/u/mrtact)\
**Post date:** [February 7, 2019, 10:05pm UTC](https://discuss.kotlinlang.org/t/calling-kotlin-react-from-javascript/11464/2 "2019-02-07T22:05:48Z")

</div>

Kotlin code can’t be executed natively by your browser, so the Kotlin/JS compiler actually _transpiles_ the code into Javascript. If you can find those JS files in your output, it should be as simple as importing the module by its path and calling the function by name, just as though you had written it in JS to begin with.
