We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7c5da7c commit c419af3Copy full SHA for c419af3
react_learn/src/main/scala/tutorial/webapp/TutorialApp.scala
@@ -6,18 +6,21 @@ import org.scalajs.dom
6
7
8
object Square {
9
- val component = ScalaComponent.builder[Unit]("Square")
10
- .renderStatic(
11
- <.button(^.cls := "square")
+ val component = ScalaComponent.builder[Int]("Square")
+ .render_P( i =>
+ <.button(
12
+ ^.cls := "square",
13
+ i
14
+ )
15
)
16
.build
17
- def apply() = component()
18
+ def apply(i: Int) = component(i)
19
}
20
21
22
object Board {
- def renderSquare(i: Int) = Square()
23
+ def renderSquare(i: Int) = Square(i)
24
25
val component = ScalaComponent.builder[Unit]("Board")
26
.renderStatic(
0 commit comments