-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't handle List in render
?
#15
Comments
Something bad is happening with typecheker, for example following code compiles: override def render(self: This) = {
@scalax val render2 = {
val content = Search(Search.Props(self.onSearch)) :: (self.state.keyword match {
case Some(keyword) => SearchResult(SearchResult.Props(filteredLinks(projects, keyword)))
case _ => Links(Links.Props(projects))
}) :: Nil
<div>
{content}
</div>
}
render2
} By the way you could rewrite this code in following way: @scalax
def render(self: This) = {
<div>
{ Search(Search.Props(self.onSearch)) }
{
self.state.keyword match {
case Some(keyword) => SearchResult(SearchResult.Props(filteredLinks(projects, keyword)))
case _ => Links(Links.Props(projects))
}
}
</div>
} I will investigate this compiler crash |
Thanks, I followed the first workaround and it's working well. I also like the 2nd, but IDEA's scala plugin mess up the style if I press format keyshort. |
There is an option to turn off formatting for XML literals. |
I have a
render
which contains aList
:It will reports error when I run
fastOptJS
:If I use a
Seq
instead, it will be all OK:If you need more information, see here: https://github.com/freewind/wind-links/blob/master/src/main/scala/in/freewind/windlinks/main/Main.scala
The text was updated successfully, but these errors were encountered: