Can I use kotlinJs react with polymer components? ...
# javascript
n
Can I use kotlinJs react with polymer components? If yes - is there a starting poing to learn about it?
s
Kotlin React is just a wrapper around React API for JS. Since you can use Polymer components in React JS, you can use it in Kotlin too. I haven’t tried, but looks like this can help: https://github.com/jscissr/react-polymer. You can write Kotlin external declarations around it, something like this:
Copy code
@JsName("PaperInput")
external class PaperInput : React.Component<RProps, RState> {
    override fun render(): ReactElement?
}

fun RBuilder.paperInput(onChange: () -> Unit, value: String) = child(PaperInput::class) {
    this.onChange = onChange
    this.value = value
    handler()
}