Daniel Rampelt
11/26/2021, 9:10 PMMenu
, Menu.Item
, Menu.Button
. I previously had something like this for the externals, but now using external object
doesn't work since FunctionComponent
is sealed:
external object Menu : FunctionComponent<...> {
val Item: FunctionComponent<...>
val Button: FunctionComponent<...>
}
Is there a better way to handle something like this?turansky
11/26/2021, 9:26 PMturansky
11/26/2021, 9:28 PMMenu
?Daniel Rampelt
11/26/2021, 9:33 PM@file:JsModule("@headlessui/react")
turansky
11/26/2021, 9:34 PM@JsName("default")
for Menu
?Daniel Rampelt
11/26/2021, 9:35 PM@headlessui/react
will be an object with all of the componentsDaniel Rampelt
11/26/2021, 9:36 PMturansky
11/26/2021, 9:38 PMturansky
11/26/2021, 9:39 PMFC
alias is preferable for declarationsDaniel Rampelt
11/26/2021, 9:40 PMHeadlessui.kt: (43, 26): Inheritance of sealed classes or interfaces from different module is prohibited
Daniel Rampelt
11/26/2021, 9:40 PMFC
has the same issue since it's just an alias thoughturansky
11/26/2021, 9:42 PM@file:Suppress("SEALED_INHERITOR_IN_DIFFERENT_MODULE")
Daniel Rampelt
11/26/2021, 9:46 PMreact
package as wellDaniel Rampelt
11/26/2021, 9:47 PM@file:JsModule("@headlessui/react")
@file:JsNonModule
@file:JsQualifier("Menu")
package headlessui
import react.FunctionComponent
@JsName("Item")
external val MenuItem: FunctionComponent<MenuItemProps>
@JsName("Button")
external val MenuButton: FunctionComponent<MenuButtonProps>
@JsName("Items")
external val MenuItems: FunctionComponent<MenuItemsProps>
Daniel Rampelt
11/26/2021, 9:48 PMexternal val Menu: ...
in the original fileturansky
11/26/2021, 9:49 PMSuppress
is preferred right nowDaniel Rampelt
11/26/2021, 9:49 PMturansky
11/26/2021, 9:51 PMsealed
will stay for FC
turansky
11/26/2021, 9:56 PMturansky
11/26/2021, 9:56 PMturansky
11/26/2021, 10:19 PM@Deprecated(replaceWith="FC")
typealias FunctionComponent<P> = FC<P>
😈turansky
11/28/2021, 3:21 PM