trait ValueConverters extends AnyRef
Mostly obvious converters so you can have a variety of children types and have them convert to ReactNodes as needed.
Watch out for values
that need to pass through 2 implicits since double implicit resolution is not
supported by scala. So you may think that these conversions should apply but
an UndefOr
wrapper on the target type means either you need to use
js.defined first and then these implicit conversions will apply automatically
or you should use .toNode
to convert the ReactNode value then let the
general implicit create an UndefOr[T]
. Just be mindful of implicit conversion
rules in scala.
- To do
Restructure as a typeclass using an "encoding" pattern, see the trait above :-).
- Alphabetic
- By Inheritance
- ValueConverters
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- implicit def _stringToElement(s: String): ReactNode
- implicit def _stringToUndefOrElement(s: String): UndefOr[ReactNode]
- implicit def anyValToElement(v: AnyVal): ReactNode
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
- implicit def eitherRightAnyToNode[T](n: Either[_, T])(implicit cvt: (T) => ReactNode): ReactNode
- implicit def eitherRightReactNodeToNode(n: Either[_, ReactNode]): ReactNode
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- implicit def func0[T](f: () => Unit): UndefOr[Function0[Unit]]
- implicit def func1[A, T](f: (A) => T): UndefOr[Function1[A, T]]
- implicit def func2[A, A2, T](f: (A, A2) => T): UndefOr[Function2[A, A2, T]]
- implicit def func3[A, A2, A3, T](f: (A, A2, A3) => T): UndefOr[Function3[A, A2, A3, T]]
- implicit def func4[A, A2, A3, A4, T](f: (A, A2, A3, A4) => T): UndefOr[Function4[A, A2, A3, A4, T]]
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- implicit def iterableOfNodeToElement(s: Iterable[ReactNode]): ReactNode
- implicit def iterableWithConversionToElement[T](s: Iterable[T])(implicit cv: (T) => ReactNode): ReactNode
Elements should have key set.
Elements should have key set. Requires an implicit to perform the conversion.
- implicit def jsArrayOfNodeToElement[T <: ReactNode](arr: Array[T]): ReactNode
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- implicit def optToElement(s: Option[ReactNode]): ReactNode
- implicit def optionAnyValToNull(n: Option[AnyVal]): ReactNode
Convert scala.AnyVal into a react node.
- implicit def optionStringToElement(n: Option[String]): ReactNode
Since null is a valid react node, convert an optional string to null.
- implicit def optionStringToUndefOr(n: Option[String]): UndefOr[String]
Implicit conversion from Option[String] => js.UndefOr[String].
- implicit def optionStringToUndefOrElement(n: Option[String]): UndefOr[ReactNode]
Since null is a valid react node, convert an optional string to null.
- implicit def seqOfNodeToElement(s: Seq[ReactNode]): ReactNode
Critical to handling varargs in component children lists.
- implicit def stringToUndefOrNode(n: UndefOr[String]): ReactNode
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- implicit def throwableToNode(t: Throwable): ReactNode
- def toString(): String
- Definition Classes
- AnyRef → Any
- implicit def tryToNode[T](t: Try[T])(implicit cvt: (T) => ReactNode): ReactNode
- implicit def undefOrAnyValToElement(v: UndefOr[AnyVal]): ReactNode
- implicit def undefOrReactNodeArrayToReactNode(n: UndefOr[Array[ReactNode]]): ReactNode
- implicit def undefOrReactNodeToReactNode(n: UndefOr[ReactNode]): ReactNode
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])