Skip to content

Commit

Permalink
Fix Scala 3
Browse files Browse the repository at this point in the history
  • Loading branch information
japgolly committed May 27, 2022
1 parent b9422b4 commit 895d454
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ sealed trait ComponentDom {

final def toText: Option[dom.Text] =
mounted.flatMap {
case t: dom.Text => Some(t)
case _ => None
case Node(t: dom.Text) => Some(t)
case _ => None
}

/** For testing purposes. */
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
package japgolly.scalajs.react

import japgolly.scalajs.react.component.Generic.{UnmountedRaw => Component}
import japgolly.scalajs.react.facade.React
import japgolly.scalajs.react.vdom.VdomNode

/** Typeclass for anything that React can render.
*
* @since v2.2.0 / React 18
*/
@inline final case class Renderable[-A](raw: A => React.Node) extends AnyVal {
@inline def apply(a: A): React.Node =
@inline final case class Renderable[-A](raw: A => facade.React.Node) extends AnyVal {
@inline def apply(a: A): facade.React.Node =
raw(a)
}

Expand All @@ -18,7 +17,7 @@ object Renderable {
@inline implicit def long: Renderable[Long] =
Renderable(_.toString)

@inline implicit def raw[A](implicit ev: A => React.Node): Renderable[A] =
@inline implicit def raw[A](implicit ev: A => facade.React.Node): Renderable[A] =
Renderable(ev)

@inline implicit def vdom: Renderable[VdomNode] =
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package japgolly.scalajs.react.test

import japgolly.scalajs.react.facade
import japgolly.scalajs.react.{facade => mainFacade}
import org.scalajs.dom

object TestContainer {
def apply(c: facade.ReactDOM.Container): TestContainer =
def apply(c: mainFacade.ReactDOM.Container): TestContainer =
new TestContainer {
override type Self = TestDom
override protected def Self(n2: dom.Node) = TestDom(n2)
Expand All @@ -23,7 +23,7 @@ object TestContainer {
*/
trait TestContainer extends TestDom {

def container: facade.ReactDOM.Container
def container: mainFacade.ReactDOM.Container

final def node =
fold(identity, identity, identity)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package japgolly.scalajs.react.test

import japgolly.scalajs.react._
import japgolly.scalajs.react.{facade => mainFacade, _}
import org.scalajs.dom

object TestReactRoot {

def apply(container: facade.ReactDOM.RootContainer): TestReactRoot =
def apply(container: mainFacade.ReactDOM.RootContainer): TestReactRoot =
apply(ReactDOM.createRoot(container), container)

def apply(root: ReactRoot, container: facade.ReactDOM.Container): TestReactRoot = {
def apply(root: ReactRoot, container: mainFacade.ReactDOM.Container): TestReactRoot = {
@inline def r = root
@inline def c = container
new TestReactRoot {
Expand Down

0 comments on commit 895d454

Please sign in to comment.