To get started, edit
app/App.kt
and save to reload.
child(type: Any, props: P, children: List) = child(createElement(type, props, *children.toTypedArray())) fun
child(type: Any, props: P, handler: RHandler
): ReactElement { val children = with(RElementBuilder(props)) { handler() childList } return child(type, props, children) } operator fun
RClass
.invoke(handler: RHandler
) = child(this, jsObject {}, handler) operator fun RProvider.invoke(value: T, handler: RHandler>) = child(this, jsObject { this.value = value }, handler) operator fun RConsumer.invoke(handler: RBuilder.(T) -> Unit) = child(this, jsObject> { this.children = { value -> buildElements { handler(value) } } }) {} fun
RClass
.node( props: P, children: List = emptyList() ) = child(this, clone(props), children) fun
> child(klazz: KClass, handler: RHandler
): ReactElement { val rClass = klazz.js as RClass
return rClass(handler) } inline fun
> child(noinline handler: RHandler
) = child(C::class, handler) fun
> node( klazz: KClass, props: P, children: List = emptyList() ): ReactElement { val rClass = klazz.js as RClass
return rClass.node(props, children) } inline fun
> node(props: P, children: List = emptyList()) = node(C::class, props, children) fun RProps.children() { childList.addAll(Children.toArray(children)) } } 3#VJMEFSΫϥε
child(type: Any, props: P, children: List) = child(createElement(type, props, *children.toTypedArray())) fun
child(type: Any, props: P, handler: RHandler
): ReactElement { val children = with(RElementBuilder(props)) { handler() childList } return child(type, props, children) } operator fun
RClass
.invoke(handler: RHandler
) = child(this, jsObject {}, handler) operator fun RProvider.invoke(value: T, handler: RHandler>) = child(this, jsObject { this.value = value }, handler) operator fun RConsumer.invoke(handler: RBuilder.(T) -> Unit) = child(this, jsObject> { this.children = { value -> buildElements { handler(value) } } }) {} fun
RClass
.node( props: P, children: List = emptyList() ) = child(this, clone(props), children) fun
> child(klazz: KClass, handler: RHandler
): ReactElement { val rClass = klazz.js as RClass
return rClass(handler) } inline fun
> child(noinline handler: RHandler
) = child(C::class, handler) fun
> node( klazz: KClass, props: P, children: List = emptyList() ): ReactElement { val rClass = klazz.js as RClass
return rClass.node(props, children) } inline fun
> node(props: P, children: List = emptyList()) = node(C::class, props, children) fun RProps.children() { childList.addAll(Children.toArray(children)) } } @ReactDsl open class RBuilder { val childList = mutableListOf()
child(type: Any, props: P, children: List) = child(createElement(type, props, *children.toTypedArray())) fun
child(type: Any, props: P, handler: RHandler
): ReactElement { val children = with(RElementBuilder(props)) { handler() childList } return child(type, props, children) } operator fun
RClass
.invoke(handler: RHandler
) = child(this, jsObject {}, handler) operator fun RProvider.invoke(value: T, handler: RHandler>) = child(this, jsObject { this.value = value }, handler) operator fun RConsumer.invoke(handler: RBuilder.(T) -> Unit) = child(this, jsObject> { this.children = { value -> buildElements { handler(value) } } }) {} fun
RClass
.node( props: P, children: List = emptyList() ) = child(this, clone(props), children) fun
> child(klazz: KClass, handler: RHandler
): ReactElement { val rClass = klazz.js as RClass
return rClass(handler) } inline fun
> child(noinline handler: RHandler
) = child(C::class, handler) fun
> node( klazz: KClass, props: P, children: List = emptyList() ): ReactElement { val rClass = klazz.js as RClass
return rClass.node(props, children) } inline fun
> node(props: P, children: List = emptyList()) = node(C::class, props, children) fun RProps.children() { childList.addAll(Children.toArray(children)) } } fun child(element: ReactElement): ReactElement { childList.add(element) return element }
child(type: Any, props: P, children: List) = child(createElement(type, props, *children.toTypedArray())) fun
child(type: Any, props: P, handler: RHandler
): ReactElement { val children = with(RElementBuilder(props)) { handler() childList } return child(type, props, children) } operator fun
RClass
.invoke(handler: RHandler
) = child(this, jsObject {}, handler) operator fun RProvider.invoke(value: T, handler: RHandler>) = child(this, jsObject { this.value = value }, handler) operator fun RConsumer.invoke(handler: RBuilder.(T) -> Unit) = child(this, jsObject> { this.children = { value -> buildElements { handler(value) } } }) {} fun
RClass
.node( props: P, children: List = emptyList() ) = child(this, clone(props), children) fun
> child(klazz: KClass, handler: RHandler
): ReactElement { val rClass = klazz.js as RClass
return rClass(handler) } inline fun
> child(noinline handler: RHandler
) = child(C::class, handler) fun
> node( klazz: KClass, props: P, children: List = emptyList() ): ReactElement { val rClass = klazz.js as RClass
return rClass.node(props, children) } inline fun
> node(props: P, children: List = emptyList()) = node(C::class, props, children) fun RProps.children() { childList.addAll(Children.toArray(children)) } } ίʔυϦʔσΟϯά LPUMJOSFBDU 3#VJMEFSΫϥε w %0.ཁૉΛ֨ೲ͢ΔDIJME-JTUϓϩύςΟΛ࣋ͭ w DIJMEϝιουɺଞʹͭ w 3$PNQPOFOUΛՃ w QSPQTͱࢠཁૉΛݸผͷҾͰՃFUD fun child(type: Any, props: P, children: List): ReactElement fun child(type: Any, props: P, handler: RHandler
): ReactElement fun child(klazz: KClass, handler: RHandler
): ReactElement inline fun child(noinline handler: RHandler
): ReactElement
createElement( type: Any, props: P, vararg child: Any? ): ReactElement
child(type: Any, props: P, children: List) = child(createElement(type, props, *children.toTypedArray())) fun
child(type: Any, props: P, handler: RHandler
): ReactElement { val children = with(RElementBuilder(props)) { handler() childList } return child(type, props, children) } operator fun
RClass
.invoke(handler: RHandler
) = child(this, jsObject {}, handler) operator fun RProvider.invoke(value: T, handler: RHandler>) = child(this, jsObject { this.value = value }, handler) operator fun RConsumer.invoke(handler: RBuilder.(T) -> Unit) = child(this, jsObject> { this.children = { value -> buildElements { handler(value) } } }) {} fun
RClass
.node( props: P, children: List = emptyList() ) = child(this, clone(props), children) fun
> child(klazz: KClass, handler: RHandler
): ReactElement { val rClass = klazz.js as RClass
return rClass(handler) } inline fun
> child(noinline handler: RHandler
) = child(C::class, handler) fun
> node( klazz: KClass, props: P, children: List = emptyList() ): ReactElement { val rClass = klazz.js as RClass
return rClass.node(props, children) } inline fun
> node(props: P, children: List = emptyList()) = node(C::class, props, children) fun RProps.children() { childList.addAll(Children.toArray(children)) } } operator fun String.unaryPlus() { childList.add(this) }