natpryce
11/24/2017, 6:23 PMchild
method takes a KClass or reified type parameter of the child component to construct, neither of which is available for extern interfacesLeonid Khachaturov
11/27/2017, 8:47 AMFilipp Riabchun
11/27/2017, 9:26 AM@JsModule("react-something")
external val ReactSomething: RClass<dynamic>
then you'll be able to call it directly in your builder like you do with div
and other builtins
fun RBuilder.foo {
ReactSomething {
// not typesafe yet
attrs.foo = "bar"
+"child text"
}
}
natpryce
11/27/2017, 9:27 AMFilipp Riabchun
11/27/2017, 9:28 AMdynamic
with props spec:
external interface ReactSomethingProps {
// should be var not val, as we will assign it
var foo: String
}
@JsModule("react-something")
external val ReactSomething: RClass<ReactSomethingProps>
natpryce
11/27/2017, 9:29 AM