Packages

trait ReactClassSpec[Props, State] extends AnyRef

Specification for React components

Example:

object Foo {
  case class Props(foo: String)
  case class State(bar: String)
}

class Foo extends ReactClassSpec[Foo.Props, Foo.State] {
  import Foo._

  override def getInitialState() = State("bar")

  override def render(): ReactElement = <.div()(
    s"foo = ${props.foo}",
    s"bar = ${state.bar}",
    children // equivalent of props.children in native React
  )
}

val foo = new Foo()
ReactDOM.render(
  foo(Foo.Props("foo"))( // first parameter group of apply method takes props
    <.div()("first child"), // second parameter group of apply method takes children
    <.div()("second child")
  ),
  mountNode
)
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ReactClassSpec
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def getInitialState(): State
  2. abstract def render(): ReactElement

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def apply(props: Props)(children: Any*): ReactElement

    Returns ReactElement

  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. def asNative: Dynamic
  7. def children: ReactElement

    Returns props.children equivalent in native React

  8. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. def componentDidMount(): Unit
  10. def componentDidUpdate(prevProps: Props, prevState: State): Unit
  11. def componentWillMount(): Unit
  12. def componentWillReceiveProps(nextProps: Props): Unit
  13. def componentWillUnmount(): Unit
  14. def componentWillUpdate(nextProps: Props, nextState: State): Unit
  15. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  16. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  17. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  18. def forceUpdate(): Unit
  19. def forceUpdate(callback: Function0[Unit]): Unit
  20. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
  21. def hashCode(): Int
    Definition Classes
    AnyRef → Any
  22. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  23. def nativeComponentDidUpdate(nativePrevProps: Dynamic, nativePrevState: Dynamic): Unit
  24. def nativeComponentWillReceiveProps(nativeNextProps: Dynamic): Unit
  25. def nativeComponentWillUpdate(nativeNextProps: Dynamic, nativeNextState: Dynamic): Unit
  26. def nativeProps: Dynamic
  27. def nativeShouldComponentUpdate(nextProps: Dynamic, nextState: Dynamic): Boolean
  28. def nativeState: Dynamic
  29. def nativeThis: Dynamic
  30. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  31. final def notify(): Unit
    Definition Classes
    AnyRef
  32. final def notifyAll(): Unit
    Definition Classes
    AnyRef
  33. def props: Props
  34. def propsFromNative(nativeProps: Dynamic): Props
  35. def propsToNative(props: Props): Dynamic
  36. def setState(stateMapper: (State, Props) ⇒ State): Unit
  37. def setState(stateMapper: (State) ⇒ State): Unit
  38. def setState(state: State): Unit
  39. def shouldComponentUpdate(nextProps: Props, nextState: State): Boolean
  40. def state: State
  41. def stateFromNative(nativeState: Dynamic): State
  42. def stateToNative(state: State): Dynamic
  43. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  44. def toString(): String
    Definition Classes
    AnyRef → Any
  45. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  46. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  47. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped