Closed freewind closed 9 years ago
It's not possible to use XML syntax for this; there is an example demonstrating embedding other components: https://github.com/xored/scala-js-react/blob/master/scalajs-react-examples/src/main/scala/com/xored/scalajs/react/examples/children/Children.scala.
Thanks, just wondering the reason of "It's not possible to use XML syntax". Is it because the macro provided by Scala is not power enough to implement it?
(I'm not familiar with Scala's macro, but really hope that's possible)
It doesn't implement it, I found it not much practical while robust implementation isn't so easy because TypedReactspec#Props
is a reference to a type. It doesn't have to be case class, or have single apply method, for example, define type Props = Unit
.
Thanks !
I see in the examples, we can just declare in XML with the standard HTML tags, like:
Is it possible to use the components we defined? like: