danfma
08/30/2017, 12:24 AMfun ReactProps.myElement(setter: MyElementProps.() -> Unit): ReactElement =
React.createElement(MyElement::class, setter(MyElementProps))
But I want to, in a context of another ReactProps, an element to be extended by the unary operator, so with that I could write something like this:
rootElement {
+myElement {
// ...
}
}
That is needed when you don’t have access to the original source of the thing that you want to understand. So we need something like this (maybe another one more beautiful syntax):
operator fun ReactProps.unaryOperator(element: ReactElement?) {
...
}