Packages

t

react

ValueConverters

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 :-).

Linear Supertypes
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ValueConverters
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Value Members

  1. implicit def _stringToElement(s: String): ReactNode
  2. implicit def _stringToUndefOrElement(s: String): UndefOr[ReactNode]
  3. implicit def anyValToElement(v: AnyVal): ReactNode
  4. implicit def eitherRightAnyToNode[T](n: Either[_, T])(implicit cvt: (T) => ReactNode): ReactNode
  5. implicit def eitherRightReactNodeToNode(n: Either[_, ReactNode]): ReactNode
  6. implicit def func0[T](f: () => Unit): UndefOr[Function0[Unit]]
  7. implicit def func1[A, T](f: (A) => T): UndefOr[Function1[A, T]]
  8. implicit def func2[A, A2, T](f: (A, A2) => T): UndefOr[Function2[A, A2, T]]
  9. implicit def func3[A, A2, A3, T](f: (A, A2, A3) => T): UndefOr[Function3[A, A2, A3, T]]
  10. implicit def func4[A, A2, A3, A4, T](f: (A, A2, A3, A4) => T): UndefOr[Function4[A, A2, A3, A4, T]]
  11. implicit def iterableOfNodeToElement(s: Iterable[ReactNode]): ReactNode
  12. 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.

  13. implicit def jsArrayOfNodeToElement[T <: ReactNode](arr: Array[T]): ReactNode
  14. implicit def optToElement(s: Option[ReactNode]): ReactNode
  15. implicit def optionAnyValToNull(n: Option[AnyVal]): ReactNode

    Convert scala.AnyVal into a react node.

  16. implicit def optionStringToElement(n: Option[String]): ReactNode

    Since null is a valid react node, convert an optional string to null.

  17. implicit def optionStringToUndefOr(n: Option[String]): UndefOr[String]

    Implicit conversion from Option[String] => js.UndefOr[String].

  18. implicit def optionStringToUndefOrElement(n: Option[String]): UndefOr[ReactNode]

    Since null is a valid react node, convert an optional string to null.

  19. implicit def seqOfNodeToElement(s: Seq[ReactNode]): ReactNode

    Critical to handling varargs in component children lists.

  20. implicit def stringToUndefOrNode(n: UndefOr[String]): ReactNode
  21. implicit def throwableToNode(t: Throwable): ReactNode
  22. implicit def tryToNode[T](t: Try[T])(implicit cvt: (T) => ReactNode): ReactNode
  23. implicit def undefOrAnyValToElement(v: UndefOr[AnyVal]): ReactNode
  24. implicit def undefOrReactNodeArrayToReactNode(n: UndefOr[Array[ReactNode]]): ReactNode
  25. implicit def undefOrReactNodeToReactNode(n: UndefOr[ReactNode]): ReactNode