O ContextComponent
é uma interface precisa ser implementada em componentes que usam o Contexto, porque é onde está o atributo context
.
Segue abaixo um exemplo de componente customizado com o contexto:
@RegisterWidget
data class CustomComponent(
val otherAttribute: String
override val context: ContextData? = null
): WidgetView(), ContextComponent
@RegisterWidget
data class CustomComponent(
val otherAttribute: String
override val context: ContextData? = null
): Widget(), ContextComponent
public struct CustomComponent: Component, HasContext {
public var context: Context?
public var otherAttribute: String
}
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.