What's the best way of doing this in Kotlin ? ```...
# react
p
What's the best way of doing this in Kotlin ?
Copy code
import {faList, faPlus} from "@fortawesome/free-solid-svg-icons";
Is there a less clunky way than this ?
Copy code
@file:JsModule("@fortawesome/free-solid-svg-icons")
@file:JsNonModule()

import react.*

@JsName("faSyncAlt")
external val faSyncAlt: RClass<RProps>

@JsName("faPlus")
external val faPlus: RClass<RProps>
n
there seem to existist .d.ts definitions for those.. so you could try the new dukat stuff add
Copy code
kotlin.js.experimental.generateKotlinExternals=true
to your gradle.properties
p
Thanks for that, I hadn't thought of it. I gave it a try but unfortunately the plugin seems to blow up processing one of my dependencies:
Copy code
Exception in thread "main" <http://java.io|java.io>.FileNotFoundException: ....bla bla....build/externals/myproject/src/index.module_@babel/types.kt (No such file or directory)
	at <http://java.io|java.io>.FileOutputStream.open0(Native Method)
	at java.io.FileOutputStream.open(FileOutputStream.java:270)
	at <http://java.io|java.io>.FileOutputStream.<init>(FileOutputStream.java:213)
	at <http://java.io|java.io>.FileOutputStream.<init>(FileOutputStream.java:162)
	at <http://kotlin.io|kotlin.io>.FilesKt__FileReadWriteKt.writeBytes(FileReadWrite.kt:84)
	at <http://kotlin.io|kotlin.io>.FilesKt__FileReadWriteKt.writeText(FileReadWrite.kt:110)
	at <http://kotlin.io|kotlin.io>.FilesKt__FileReadWriteKt.writeText$default(FileReadWrite.kt:110)
	at org.jetbrains.dukat.cli.CliKt.compileUnits(cli.kt:79)
	at org.jetbrains.dukat.cli.CliKt.compile(cli.kt:44)
	at org.jetbrains.dukat.cli.CliKt.main(cli.kt:260)
n
too bad, it could have been soo easy
😧 1
b
cc @[JB] Shagen