kotlin-wrappers
kotlin-wrappers copied to clipboard
Missing "component" prop [kotlin-mui]
- The
ButtonBase
is missing thecomponent
property. Probably because it needs to inherit fromPropsWithComponent
See ButtonBase & OverridableComponent source - The
IconButton
should inherit props fromButtonBase
(to access e.g.component
) See IconButton source
Came here to ask for the same thing
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!