What is the easiest way to write this ({value}) => <li>{value}</li>
stateless react component in scalajs-react ?
I've found the following related links on the net but they do not answer the question:
https://gitter.im/japgolly/scalajs-react?at=557e2a0dc030cae67ed3a4c3 https://github.com/japgolly/scalajs-react/blob/master/core/src/main/scala/japgolly/scalajs/react/ReactComponentB.scala#L41 https://gitter.im/japgolly/scalajs-react?at=561705054e0fa3e55447ba98 http://www.gitterforum.com/discussion/japgolly-scalajs-react?page=269 https://gitter.im/japgolly/scalajs-react?at=57ae33f90fd99f7041367604
This seems to be the closest to an answer:
https://gitter.im/japgolly/scalajs-react?at=575347a19be9c5b637f07a00
case class StatelessProps(name: String)
val stateless = FunctionalComponent((props: StatelessProps) => {
<.span(s"My name is ${props.name}")
})
I am not sure though if this is a stateless react component or not.
Is FunctionalComponent the same as stateless react component ?
OK, it seems that it is : https://gitter.im/japgolly/scalajs-react?at=575329dc9be9c5b637f074e8