How are these kind of imports translated to Kotlin...
# javascript
n
How are these kind of imports translated to Kotlin?
Copy code
import { Transition } from '@headlessui/react'

 <Transition.Child />

OR 
<motion.div
As JsName doesn't accept
.
, tried some shenanginas with extension functions but cannot get it to work
b
Copy code
@JsModule("@headlessui/react")
external object HeadlessUI {
 class Transition {
    class Child
  }
}

// Usage

HeadlessUI.Transition.Child
Alternatively, to avoid object wrapping
Copy code
@file:JsModule("@headlessui/react")

class Transition {
  class Child
}

// Usage

Transition.Child
n
Copy code
@file:JsModule("@headlessui/react")

external class Transition: ComponentClass<TransitionProps> {
    class Child : ComponentClass<TransitionChildProps> {}
}

external interface TransitionProps : Props {
}
Something along these lines? But now I have to implement the Component Class Tried FC<P> instead of ComponentClass but I lose the ability for this kind of syntax
Copy code
Transition.Child {
        attrs. ... = ...
}
a
I would be going for
TransitionChild
syntax instead of
Transition.Child
n
@andylamax how can I achieve that? I don't mind either
a
Copy code
@JsModule("@headlessui/react")
external val Transition : ComponentType<TransitionProps>

val TransitionChild : ComponentType<TransitionChildProps> = Transition.asDynamic().Child
👌 1
t
@Daniel Rampelt do you have open wrappers for
headlessui
?
d
No sorry, just have them as part of my project for now
b
Might still be worth sharing it here for copy/paste at least