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

add reactstrap wrapper

Open frhack opened this issue 2 years ago • 1 comments

Hi, I tried to use reactstrap via dukat without success.

Please add a wrapper.

thanks

https://github.com/reactstrap/reactstrap

frhack avatar Apr 28 '22 15:04 frhack

Hi, after a few tries I found a working setup to use reactstrap in kotlin.

Keep up the good work !

https://gist.github.com/frhack/d5abdb7db4fd7a0bfcd10411b32f9991

then I just needed to provide the external declarations:

//file Alert.kt
@file:JsModule("reactstrap")
@file:JsNonModule

import react.*

@JsName("Alert")
external val Alert : ComponentClass<AlertProps>

external interface AlertProps : Props {
    var color: String
}

and add the css:

    <head>
        <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" />
    </head>

frhack avatar Apr 29 '22 14:04 frhack