kotlin-wrappers
kotlin-wrappers copied to clipboard
How to set MUI breakpoint values
Hi, I am trying to convert the following code:
<Grid container spacing={3}>
<Grid xs="auto">
<Item>variable width content</Item>
</Grid>
<Grid xs={6}>
<Item>xs=6</Item>
</Grid>
<Grid xs>
<Item>xs</Item>
</Grid>
</Grid>
to Kotlin using kotlin-mui.
The issue I am having is that I don't know how to set the value for the xs breakpoint.
WA
inline var GridProps.xs: Any?
get() = asDynamic().xs
set(value) = asDynamic().xs = value
Get the following error when I try the above
Assignments are not expressions, and only expressions are allowed in this context
This works though
inline var GridProps.xs: Any?
get() = asDynamic().xs
set(value) {
asDynamic().xs = value
}
I have these extensions now for GridProps
inline var GridProps.xs: Int
get() = throw NotImplementedError("Prop is write-only!")
set(value) {
asDynamic().xs = value
}
inline var GridProps.justifyContent: String
get() = throw NotImplementedError("Prop is write-only!")
set(value) {
asDynamic().justifyContent = value
}
inline var GridProps.alignItems: String
get() = throw NotImplementedError("Prop is write-only!")
set(value) {
asDynamic().alignItems = value
Expected extensions:
inline var GridProps.justifyContent: JustifyContent
get() = asDynamic().justifyContent
set(value) {
asDynamic().justifyContent = value
}
inline var GridProps.alignItems: AlignItems
get() = asDynamic().alignItems
set(value) {
asDynamic().alignItems = value
Is there a plan to include these extensions in the library?