Browse Source

Invoke disposable effect only if refEffect.effect is not null

DOM_APPLIER_REFACTORED
Shagen Ogandzhanian 3 years ago
parent
commit
cc091973af
  1. 6
      web/core/src/jsMain/kotlin/org/jetbrains/compose/web/elements/Base.kt

6
web/core/src/jsMain/kotlin/org/jetbrains/compose/web/elements/Base.kt

@ -81,8 +81,10 @@ fun <TElement : Element> TagElement(
content = content
)
DisposableEffect(null) {
refEffect.effect?.invoke(this, scope.element) ?: onDispose {}
refEffect.effect?.let { refEffect ->
DisposableEffect(null) {
refEffect.invoke(this, scope.element)
}
}
}

Loading…
Cancel
Save