Skip to content

Commit feea6a4

Browse files
committed
Added ReactTagOf type alias and changelog entry
1 parent ad0b0f0 commit feea6a4

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

core/src/main/scala/japgolly/scalajs/react/vdom/package.scala

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,10 @@ package object vdom {
1919

2020
// If you're wondering why abstract class instead of trait, https://issues.scala-lang.org/browse/SI-4767
2121
abstract class Base extends Implicits {
22-
final type ReactTag = japgolly.scalajs.react.vdom.ReactTagOf[TopNode]
23-
final type TagMod = japgolly.scalajs.react.vdom.TagMod
22+
final type ReactTagOf[+N <: TopNode] = japgolly.scalajs.react.vdom.ReactTagOf[N]
23+
final type ReactTag = japgolly.scalajs.react.vdom.ReactTagOf[TopNode]
24+
final type TagMod = japgolly.scalajs.react.vdom.TagMod
25+
2426
@inline final def TagMod = japgolly.scalajs.react.vdom.TagMod
2527
@inline final def EmptyTag = japgolly.scalajs.react.vdom.EmptyTag
2628
}

doc/CHANGELOG-0.10.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,12 @@ Unlike the `render` methods, this migration can be automated (see below).
367367

368368
* Upgrade scala-js-dom 0.8.{1 ⇒ 2}.
369369

370+
* Added `ReactTagOf` to provide more specific types for scalatags. `ReactTag` is the kept the same as before for compatibility or if you don't need it.
371+
```scala
372+
val specific: ReactTagOf[html.Div] = div()
373+
val general: ReactTag = specific
374+
```
375+
370376
---
371377

372378
### Migration commands

0 commit comments

Comments
 (0)