how can I use <kotlin-styled> with the new Kotlin ...
# react
p
how can I use kotlin-styled with the new Kotlin React approach? I see that e.g.
styledImg
is defined as an extension function on
RBuilder
, not
ChildrenBuilder
. If there's another recommended way to create simple HTML elements with type-safe CSS, I'm happy to migrate there, it's just nice to make it explicit in the docs
let me partially answer the question - we can use e.g.
Copy code
react.dom.html.ReactHTML.img
which exposes a
style: react.CSSProperties
property which is type-aliased to
csstype.Properties
. However, there's some issue with my specific use case and I cannot migrate yet: https://github.com/JetBrains/kotlin-wrappers/issues/1132
t
If there’s another recommended way to create simple HTML elements with type-safe CSS, I’m happy to migrate there
You can use
kotlin-react-css
- example
👍 1
p
thanks, the
Filter
issue still stands
t
Yes, one more converter run required