
main.react.ComponentClass.kt Maven / Gradle / Ivy
package react
import kotlin.reflect.KClass
// TODO: Should extend RComponentClassStatics, but has problems with generic params
external interface ComponentClass :
ComponentType,
RComponentClassStatics?>
val KClass>.react: ComponentClass
get() = js.unsafeCast>()
external interface RComponentClassStatics?> {
var displayName: String?
var defaultProps: P?
var contextType: C
var getDerivedStateFromProps: ((P, S) -> S?)?
var getDerivedStateFromError: ((Throwable) -> S?)?
}
/**
* Usage:
*
* ```
* companion object : RStatics(RComponent::class) {
* init {
* defaultProps = ...
* ...
* }
* }
* ```
*
* in your class components
*/
open class RStatics, CTX : Context<*>?>(
klazz: KClass,
) : RComponentClassStatics by klazz.js.unsafeCast>()
© 2015 - 2025 Weber Informatics LLC | Privacy Policy