t
io.github.shogowada.scalajs.reactjs.classes.specs
ReactClassSpec
Companion object ReactClassSpec
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
Known Subclasses
Ordering
- Alphabetic
- By Inheritance
Inherited
- ReactClassSpec
- AnyRef
- Any
- Hide All
- Show All
Visibility
- Public
- All
Abstract Value Members
- abstract def getInitialState(): State
- abstract def render(): ReactElement
Concrete 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
-
def
apply(props: Props)(children: Any*): ReactElement
Returns ReactElement
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
- def asNative: Dynamic
-
def
children: ReactElement
Returns props.children equivalent in native React
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
- def componentDidMount(): Unit
- def componentDidUpdate(prevProps: Props, prevState: State): Unit
- def componentWillMount(): Unit
- def componentWillReceiveProps(nextProps: Props): Unit
- def componentWillUnmount(): Unit
- def componentWillUpdate(nextProps: Props, nextState: State): Unit
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
- def forceUpdate(): Unit
- def forceUpdate(callback: Function0[Unit]): Unit
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def nativeComponentDidUpdate(nativePrevProps: Dynamic, nativePrevState: Dynamic): Unit
- def nativeComponentWillReceiveProps(nativeNextProps: Dynamic): Unit
- def nativeComponentWillUpdate(nativeNextProps: Dynamic, nativeNextState: Dynamic): Unit
- def nativeProps: Dynamic
- def nativeShouldComponentUpdate(nextProps: Dynamic, nextState: Dynamic): Boolean
- def nativeState: Dynamic
- def nativeThis: Dynamic
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- def props: Props
- def propsFromNative(nativeProps: Dynamic): Props
- def propsToNative(props: Props): Dynamic
- def setState(stateMapper: (State, Props) ⇒ State): Unit
- def setState(stateMapper: (State) ⇒ State): Unit
- def setState(state: State): Unit
- def shouldComponentUpdate(nextProps: Props, nextState: State): Boolean
- def state: State
- def stateFromNative(nativeState: Dynamic): State
- def stateToNative(state: State): Dynamic
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )