kotlin-wrappers icon indicating copy to clipboard operation
kotlin-wrappers copied to clipboard

Missing "component" prop [kotlin-mui]

Open hofi99 opened this issue 2 years ago • 2 comments

  1. The ButtonBase is missing the component property. Probably because it needs to inherit from PropsWithComponent See ButtonBase & OverridableComponent source
  2. The IconButton should inherit props from ButtonBase (to access e.g. component) See IconButton source

hofi99 avatar Apr 14 '22 14:04 hofi99

Came here to ask for the same thing

keith-miller avatar Sep 18 '22 16:09 keith-miller

Got a work around from @turansky on the Kotlin Slack:

inline var ButtonProps.component: react.ElementType<*>?
    get() = asDynamic()["component"]
    set(value) {
        asDynamic()["component"] = value
    }
​
//..
	
Button {
    variant = ButtonVariant.contained
    component = react.router.dom.Link
    this as react.router.dom.LinkProps
    to = "$path"
    reloadDocument = false
​
    +"View"
}

Again, thank you!

keith-miller avatar Sep 20 '22 16:09 keith-miller