# JavaScript

**URL:** https://discuss.kotlinlang.org/c/javascript/13.md?page=1

[Latest](https://discuss.kotlinlang.org/latest.md) · [Categories](https://discuss.kotlinlang.org/categories.md)

**Page:** 2

---

## [How do I call InputEvent.inputType in Kotlin/js](https://discuss.kotlinlang.org/t/how-do-i-call-inputevent-inputtype-in-kotlin-js/26414)

<div class="topic-metadata">

**Author:** [@dlwss](https://discuss.kotlinlang.org/u/dlwss)\
**Replies:** 0\
**Last updated:** [February 22, 2023, 2:54am UTC](https://discuss.kotlinlang.org/t/how-do-i-call-inputevent-inputtype-in-kotlin-js/26414 "2023-02-22T02:54:20Z")

</div>

I checked the standard library. Without this attribute in the InputEvent - Kotlin Programming Language, but in the standard WebAPI has this property InputEvent.inputType - Web APIs | MDN So how do I call this property…

---

## [Angular and Kotlin/JS](https://discuss.kotlinlang.org/t/angular-and-kotlin-js/18158)

<div class="topic-metadata">

**Author:** [@lamba92](https://discuss.kotlinlang.org/u/lamba92)\
**Replies:** 4\
**Last updated:** [January 24, 2023, 3:03pm UTC](https://discuss.kotlinlang.org/t/angular-and-kotlin-js/18158 "2023-01-24T15:03:19Z")

</div>

During the latest Kotlinconf it was mentioned that JB was working to make Kotlin/JS interop better with Angular2+ (who cares about AngularJS!). Has something already been shown?

---

## [Using Kotlin/JS compiler in Svelte "compiler"](https://discuss.kotlinlang.org/t/using-kotlin-js-compiler-in-svelte-compiler/19808)

<div class="topic-metadata">

**Author:** [@sebastien.hamel](https://discuss.kotlinlang.org/u/sebastien.hamel)\
**Replies:** 9\
**Last updated:** [January 17, 2023, 5:58pm UTC](https://discuss.kotlinlang.org/t/using-kotlin-js-compiler-in-svelte-compiler/19808 "2023-01-17T17:58:21Z")

</div>

Hi, I am trying to use Kotlin/JS to develop a Svelte application, since Svelte is basically a compiler, any language targeting Javascript could theoretically be used to create a Svelte Web application. The Svelte framew…

---

## [Can't import Kotlin JS module in Rollup/Svelte](https://discuss.kotlinlang.org/t/cant-import-kotlin-js-module-in-rollup-svelte/9212)

<div class="topic-metadata">

**Author:** [@nanodeath](https://discuss.kotlinlang.org/u/nanodeath)\
**Replies:** 6\
**Last updated:** [January 14, 2023, 5:01pm UTC](https://discuss.kotlinlang.org/t/cant-import-kotlin-js-module-in-rollup-svelte/9212 "2023-01-14T17:01:09Z")

</div>

Sorry for yet another JS question, but I’ve been banging my head against the wall on this for a couple hours. Svelte is a framework for SPAs vaguely like React, for the sake of this question. Svelte components are .html…

---

## [Kotlin JavaScript Gradle Plugin: Scoped Package Name](https://discuss.kotlinlang.org/t/kotlin-javascript-gradle-plugin-scoped-package-name/13410)

<div class="topic-metadata">

**Author:** [@cbbaumann](https://discuss.kotlinlang.org/u/cbbaumann)\
**Replies:** 2\
**Last updated:** [December 19, 2022, 7:41pm UTC](https://discuss.kotlinlang.org/t/kotlin-javascript-gradle-plugin-scoped-package-name/13410 "2022-12-19T19:41:45Z")

</div>

How can I set the npm package scope using the kotlin-gradle-plugin? Looking at PackageJson.kt in kotlin-gradle-pluing I can see that npm scoped package names seem to be supported: companion object { fun scopedName(…

---

## [Bluetooth web api Kotlin](https://discuss.kotlinlang.org/t/bluetooth-web-api-kotlin/9188)

<div class="topic-metadata">

**Author:** [@f98f96](https://discuss.kotlinlang.org/u/f98f96)\
**Replies:** 1\
**Last updated:** [December 9, 2022, 6:25pm UTC](https://discuss.kotlinlang.org/t/bluetooth-web-api-kotlin/9188 "2022-12-09T18:25:46Z")

</div>

Hey, mb somebody work with bluetooth web api like this Bluetooth - Web APIs | MDN i cant find any info about this

---

## [MPP/JS code completion in HTML editor](https://discuss.kotlinlang.org/t/mpp-js-code-completion-in-html-editor/25981)

<div class="topic-metadata">

**Author:** [@tango24](https://discuss.kotlinlang.org/u/tango24)\
**Replies:** 0\
**Last updated:** [November 21, 2022, 10:13am UTC](https://discuss.kotlinlang.org/t/mpp-js-code-completion-in-html-editor/25981 "2022-11-21T10:13:23Z")

</div>

I have a full-stack Kotlin MPP with three modules (‘client’, ‘server’ and ‘shared’). The client project contains static HTML pages which reference the generated js code with \<script type="text/javascript" src="./client…

---

## [MUI Autocomplete options Array Problem](https://discuss.kotlinlang.org/t/mui-autocomplete-options-array-problem/25689)

<div class="topic-metadata">

**Author:** [@LeaveX007](https://discuss.kotlinlang.org/u/LeaveX007)\
**Replies:** 2\
**Last updated:** [November 15, 2022, 4:23pm UTC](https://discuss.kotlinlang.org/t/mui-autocomplete-options-array-problem/25689 "2022-11-15T16:23:05Z")

</div>

Hy, i had this code: val cars = arrayOf("Volvo", "BMW", "Ford", "Mazda") and Autocomplete from MUI Autocomplete { options=cars } The Props options=cars i get an error like " " I dont understand, why because ther…

---

## [How to add @JsName to a platform function](https://discuss.kotlinlang.org/t/how-to-add-jsname-to-a-platform-function/6238)

<div class="topic-metadata">

**Author:** [@spungin](https://discuss.kotlinlang.org/u/spungin)\
**Replies:** 4\
**Last updated:** [November 14, 2022, 5:37pm UTC](https://discuss.kotlinlang.org/t/how-to-add-jsname-to-a-platform-function/6238 "2022-11-14T17:37:11Z")

</div>

I currently have a Multiplatform class called PrettyPrinter with a function called jsonToString. When calling it from Javascript, I need to use the mangled name, although none of my classnames or interfaces are mangled. …

---

## [Kotlin JS - resources in dependency not available to webpack dev client](https://discuss.kotlinlang.org/t/kotlin-js-resources-in-dependency-not-available-to-webpack-dev-client/23240)

<div class="topic-metadata">

**Author:** [@fatalcatharsis](https://discuss.kotlinlang.org/u/fatalcatharsis)\
**Replies:** 1\
**Last updated:** [October 14, 2022, 7:11pm UTC](https://discuss.kotlinlang.org/t/kotlin-js-resources-in-dependency-not-available-to-webpack-dev-client/23240 "2022-10-14T19:11:55Z")

</div>

I am working on a multiplatform library that is supposed to be consumed by a multiplatform application. I have some css and woff files in the library that is a dependency of the application. When I run jsBrwoserDevelopme…

---

## [Is there a RangeSlider in kotlin react?](https://discuss.kotlinlang.org/t/is-there-a-rangeslider-in-kotlin-react/25635)

<div class="topic-metadata">

**Author:** [@swi](https://discuss.kotlinlang.org/u/swi)\
**Replies:** 1\
**Last updated:** [September 13, 2022, 7:24am UTC](https://discuss.kotlinlang.org/t/is-there-a-rangeslider-in-kotlin-react/25635 "2022-09-13T07:24:13Z")

</div>

Hello, I’m looking for a Slider where I can set the start and the endpoint like this: I saw that there is a kotlin-mui library: kotlin-wrappers/kotlin-mui at master · JetBrains/kotlin-wrappers · GitHub But I didn’t …

---

## [Deployment variables](https://discuss.kotlinlang.org/t/deployment-variables/25622)

<div class="topic-metadata">

**Author:** [@keith](https://discuss.kotlinlang.org/u/keith)\
**Replies:** 0\
**Last updated:** [September 7, 2022, 7:50pm UTC](https://discuss.kotlinlang.org/t/deployment-variables/25622 "2022-09-07T19:50:43Z")

</div>

Hello, I’m new to Kotlin/JS and was wondering what the best way to configure per environment variables? The url for my API calls is going to be different between local development and when the app is deployed. Seems lik…

---

## [Angular 2 for Kotlin?](https://discuss.kotlinlang.org/t/angular-2-for-kotlin/2302)

<div class="topic-metadata">

**Author:** [@miguelangellv](https://discuss.kotlinlang.org/u/miguelangellv)\
**Replies:** 15\
**Last updated:** [November 13, 2018, 10:16am UTC](https://discuss.kotlinlang.org/t/angular-2-for-kotlin/2302 "2018-11-13T10:16:14Z")

</div>

Kotlin 1.1 will use ts2kt for transform TypeScript definition of javascripts library in kotlin definition. But Angular 2 have native version of TS so don’t have definiton So, will we have a Angular 2 port for kotlin?

---

## [onClick dont open an Dialog](https://discuss.kotlinlang.org/t/onclick-dont-open-an-dialog/25512)

<div class="topic-metadata">

**Author:** [@LeaveX007](https://discuss.kotlinlang.org/u/LeaveX007)\
**Replies:** 0\
**Last updated:** [August 22, 2022, 3:55pm UTC](https://discuss.kotlinlang.org/t/onclick-dont-open-an-dialog/25512 "2022-08-22T15:55:11Z")

</div>

Hy, i have this code: val handleStart: MouseEventHandler\<HTMLButtonElement\> = { this.child(Start.create()) } ... Button { onclick=handleStart } but the Start FC doestn open. Can anyone help me please? …

---

## [React Class and styles - Class overwrites css](https://discuss.kotlinlang.org/t/react-class-and-styles-class-overwrites-css/25504)

<div class="topic-metadata">

**Author:** [@LeaveX007](https://discuss.kotlinlang.org/u/LeaveX007)\
**Replies:** 0\
**Last updated:** [August 20, 2022, 9:08pm UTC](https://discuss.kotlinlang.org/t/react-class-and-styles-class-overwrites-css/25504 "2022-08-20T21:08:45Z")

</div>

Hy, I have following code css { gridColumnStart = "1".unsafeCast\<GridColumnStart\>() gridColumnEnd = "4".unsafeCast\<GridColumnEnd\>() } className = ClassName("link") I need the Class and the different style. Th…

---

## [RSA like java.crypto](https://discuss.kotlinlang.org/t/rsa-like-java-crypto/25501)

<div class="topic-metadata">

**Author:** [@MisterAssm](https://discuss.kotlinlang.org/u/MisterAssm)\
**Replies:** 0\
**Last updated:** [August 20, 2022, 7:25pm UTC](https://discuss.kotlinlang.org/t/rsa-like-java-crypto/25501 "2022-08-20T19:25:52Z")

</div>

I would like to know if there is a library or some way to encrypt information with Kotlin/JS, like the Cipher class from javax.crypto does Exemple code Only working with Kotlin/JVM RSAPublicKeySpec(mr.toBigInte…

---

## [\[React\] Is there a way to use React Portals?](https://discuss.kotlinlang.org/t/react-is-there-a-way-to-use-react-portals/25282)

<div class="topic-metadata">

**Author:** [@PietroLinguini](https://discuss.kotlinlang.org/u/PietroLinguini)\
**Replies:** 0\
**Last updated:** [July 26, 2022, 3:55am UTC](https://discuss.kotlinlang.org/t/react-is-there-a-way-to-use-react-portals/25282 "2022-07-26T03:55:20Z")

</div>

The function I suppose I should use is: createPortal( children: ReactNode?, container: Element, key: Key? = definedExternally, ) What I tried is doing something like this: A component (Modal.kt) val Modal…

---

## [Null-safe assertion on a Array fails in Kotlin/JS](https://discuss.kotlinlang.org/t/null-safe-assertion-on-a-array-fails-in-kotlin-js/25184)

<div class="topic-metadata">

**Author:** [@rkbalgi](https://discuss.kotlinlang.org/u/rkbalgi)\
**Replies:** 0\
**Last updated:** [July 11, 2022, 6:16am UTC](https://discuss.kotlinlang.org/t/null-safe-assertion-on-a-array-fails-in-kotlin-js/25184 "2022-07-11T06:16:13Z")

</div>

The is the test case - https://github.com/rkbalgi/iso4k-mp/blob/main/src/jsTest/kotlin/SpecTestsJs.kt#L17 Note the use of null-assertion (children!!) which is not required. However, changing this to children? causes the…

---

## [.d.ts to Kotlin?](https://discuss.kotlinlang.org/t/d-ts-to-kotlin/25005)

<div class="topic-metadata">

**Author:** [@cutewarriorlover](https://discuss.kotlinlang.org/u/cutewarriorlover)\
**Replies:** 1\
**Last updated:** [July 5, 2022, 3:27am UTC](https://discuss.kotlinlang.org/t/d-ts-to-kotlin/25005 "2022-07-05T03:27:54Z")

</div>

Is there any way that I can automatically generate Kotlin files with external definitions from npm dependency .d.ts files? For example, I want to try to make the phaser library work with Kotlin, but don’t want to define …

---

## [Kotlin-multiplatform : how to use Kotlin Flow in Javascript](https://discuss.kotlinlang.org/t/kotlin-multiplatform-how-to-use-kotlin-flow-in-javascript/17587)

<div class="topic-metadata">

**Author:** [@ChintanSoni](https://discuss.kotlinlang.org/u/ChintanSoni)\
**Replies:** 2\
**Last updated:** [June 30, 2022, 10:30am UTC](https://discuss.kotlinlang.org/t/kotlin-multiplatform-how-to-use-kotlin-flow-in-javascript/17587 "2022-06-30T10:30:59Z")

</div>

I have created a kotlin multi-platform library to design Domain layer that targets JVM and JS (nodejs and browser). Domain depends on UseCase, UseCase depends on Repository, Repository depends on Service and Database. AF…

---

## [Having trouble creating Kotlin bindings for jwt-decode library](https://discuss.kotlinlang.org/t/having-trouble-creating-kotlin-bindings-for-jwt-decode-library/25087)

<div class="topic-metadata">

**Author:** [@jojo58](https://discuss.kotlinlang.org/u/jojo58)\
**Replies:** 1\
**Last updated:** [June 24, 2022, 5:14pm UTC](https://discuss.kotlinlang.org/t/having-trouble-creating-kotlin-bindings-for-jwt-decode-library/25087 "2022-06-24T17:14:23Z")

</div>

So, I’m kind of new to Kotlin/JS and I’m trying to create Kotlin bindings for the jwt-decode library. Here are the Kotlin bindings I’ve written: /\*\* \* A Kotlin definition for the jwt-decode library's invalid token err…

---

## [How to access a js function with a default function parameter](https://discuss.kotlinlang.org/t/how-to-access-a-js-function-with-a-default-function-parameter/25041)

<div class="topic-metadata">

**Author:** [@frhack](https://discuss.kotlinlang.org/u/frhack)\
**Replies:** 0\
**Last updated:** [June 17, 2022, 6:56am UTC](https://discuss.kotlinlang.org/t/how-to-access-a-js-function-with-a-default-function-parameter/25041 "2022-06-17T06:56:15Z")

</div>

Hi, i’m trying to use react-admin from kotlinjs I can’t find the right syntax to translate in kotlin, this simple page: import \* as React from "react"; import { Admin } from 'react-admin'; import jsonServerProvider fr…

---

## [Kotlin JS IR slow build time](https://discuss.kotlinlang.org/t/kotlin-js-ir-slow-build-time/24942)

<div class="topic-metadata">

**Author:** [@piacenti](https://discuss.kotlinlang.org/u/piacenti)\
**Replies:** 1\
**Last updated:** [June 6, 2022, 7:20pm UTC](https://discuss.kotlinlang.org/t/kotlin-js-ir-slow-build-time/24942 "2022-06-06T19:20:34Z")

</div>

I recently switched a fairly large JS project to use the IR compiler. I also enabled incremental compilation. A cold build takes more than 3 minutes. Small changes may take anything from 40s to 3 min (most commonly over…

---

## [Incremental migration of typescript projects to Kotlin](https://discuss.kotlinlang.org/t/incremental-migration-of-typescript-projects-to-kotlin/13416)

<div class="topic-metadata">

**Author:** [@joffrey.bion](https://discuss.kotlinlang.org/u/joffrey.bion)\
**Replies:** 8\
**Last updated:** [June 1, 2022, 12:08am UTC](https://discuss.kotlinlang.org/t/incremental-migration-of-typescript-projects-to-kotlin/13416 "2022-06-01T00:08:57Z")

</div>

Is there a way to incrementally migrate a TS code base to Kotlin/JS? A bit of context. I have a Gradle multi-project build which consists of: a Spring Boot server (in Kotlin) a React app (in typescript) built using Cr…

---

## [Anyone has tried next.js with kotlin/js?](https://discuss.kotlinlang.org/t/anyone-has-tried-next-js-with-kotlin-js/20617)

<div class="topic-metadata">

**Author:** [@sebastien.hamel](https://discuss.kotlinlang.org/u/sebastien.hamel)\
**Replies:** 4\
**Last updated:** [May 25, 2022, 1:22pm UTC](https://discuss.kotlinlang.org/t/anyone-has-tried-next-js-with-kotlin-js/20617 "2022-05-25T13:22:17Z")

</div>

I am wondering if using next.js from Kotlin/JS would be a good option… Any opinions? experiences?

---

## [Kotlin JS React accessing/configuring environment variables](https://discuss.kotlinlang.org/t/kotlin-js-react-accessing-configuring-environment-variables/16906)

<div class="topic-metadata">

**Author:** [@quackerjeff](https://discuss.kotlinlang.org/u/quackerjeff)\
**Replies:** 10\
**Last updated:** [May 16, 2022, 7:57am UTC](https://discuss.kotlinlang.org/t/kotlin-js-react-accessing-configuring-environment-variables/16906 "2022-05-16T07:57:37Z")

</div>

I’m curious how I would use .env, .env.local, etc. in my Kotlin React application. I am using gradle, and essentially I want to be able to use different values depending upon my environment. Typically I would just crea…

---

## [What is the replacement for legacy KotlinJS React's RBuilder?](https://discuss.kotlinlang.org/t/what-is-the-replacement-for-legacy-kotlinjs-reacts-rbuilder/24643)

<div class="topic-metadata">

**Author:** [@Violet](https://discuss.kotlinlang.org/u/Violet)\
**Replies:** 0\
**Last updated:** [April 17, 2022, 12:02pm UTC](https://discuss.kotlinlang.org/t/what-is-the-replacement-for-legacy-kotlinjs-reacts-rbuilder/24643 "2022-04-17T12:02:22Z")

</div>

React legacy’s documentation suggested a potential pattern in which extension functions on the RBuilder object are used to make cleaner HTML. The kotlin.xhtml documentation also suggests the same pattern. With the recen…

---

## [Kotlin JS: Upgrading a single library in yarn.lock](https://discuss.kotlinlang.org/t/kotlin-js-upgrading-a-single-library-in-yarn-lock/24516)

<div class="topic-metadata">

**Author:** [@Loke](https://discuss.kotlinlang.org/u/Loke)\
**Replies:** 1\
**Last updated:** [April 2, 2022, 1:29pm UTC](https://discuss.kotlinlang.org/t/kotlin-js-upgrading-a-single-library-in-yarn-lock/24516 "2022-04-02T13:29:54Z")

</div>

As is well known, when bringing in just a single library using node, you often end up with a lot of transient dependencies as well. I am in the situation that I need to upgrade a single transient dependency which is cur…

---

## [How to debug multi-executable JS applications](https://discuss.kotlinlang.org/t/how-to-debug-multi-executable-js-applications/23972)

<div class="topic-metadata">

**Author:** [@Loke](https://discuss.kotlinlang.org/u/Loke)\
**Replies:** 0\
**Last updated:** [January 19, 2022, 6:56am UTC](https://discuss.kotlinlang.org/t/how-to-debug-multi-executable-js-applications/23972 "2022-01-19T06:56:07Z")

</div>

I’m currently writing an application which compiles to Javascript. When testing, I’m using the jsBrowserDevelopmentRun Gradle task which allows me to easily test my code. I have now added a second js task in build.gradl…

---

## [Collection types in generated d.ts file](https://discuss.kotlinlang.org/t/collection-types-in-generated-d-ts-file/23796)

<div class="topic-metadata">

**Author:** [@pikaqiu](https://discuss.kotlinlang.org/u/pikaqiu)\
**Replies:** 4\
**Last updated:** [January 4, 2022, 10:20am UTC](https://discuss.kotlinlang.org/t/collection-types-in-generated-d-ts-file/23796 "2022-01-04T10:20:12Z")

</div>

In my code, I export a function like this: @JsExport fun calculatePrice( position: FuturePosition, positionList: List\<FuturePosition\>, balanceList: List\<FutureBalance\>, bracketList: List\<FutureBracket\>, ): Doubl…

[Previous page](https://discuss.kotlinlang.org/c/javascript/13.md)

[Next page](https://discuss.kotlinlang.org/c/javascript/13.md?page=2)
