You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
53 lines
1.1 KiB
53 lines
1.1 KiB
package com.example.playscalajsreact.model
|
|
|
|
import japgolly.scalajs.react._
|
|
import japgolly.scalajs.react.vdom.html_<^._
|
|
|
|
object Top {
|
|
|
|
final case class Props() {
|
|
@inline def render: VdomElement = Component(this)
|
|
}
|
|
|
|
//implicit val reusabilityProps: Reusability[Props] =
|
|
// Reusability.derive
|
|
|
|
final class Backend($: BackendScope[Props, Unit]) {
|
|
def render(p: Props): VdomNode =
|
|
<.div
|
|
}
|
|
|
|
val Component = ScalaComponent.builder[Props]("Top")
|
|
.renderBackend[Backend]
|
|
//.configure(Reusability.shouldComponentUpdate)
|
|
.build
|
|
|
|
def apply() = Component(Props())
|
|
}
|
|
|
|
import japgolly.scalajs.react._
|
|
import japgolly.scalajs.react.vdom.all._
|
|
|
|
object Test2 {
|
|
|
|
final case class Props()
|
|
|
|
//implicit val reusabilityProps: Reusability[Props] =
|
|
// Reusability.derive
|
|
|
|
final class Backend($: BackendScope[Props, Unit]) {
|
|
def render(p: Props): VdomNode =
|
|
<.div
|
|
}
|
|
|
|
private val Test2Component = ScalaComponent.builder[Props]("Test2")
|
|
.renderBackend[Backend]
|
|
//.configure(Reusability.shouldComponentUpdate)
|
|
.build
|
|
|
|
def apply(): VdomElement = Test2Component(Props())
|
|
}
|
|
|
|
object Test3 {
|
|
Test2()
|
|
}
|