Browse Source

Invoke disposable effect only if refEffect.effect is not null

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

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

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

Loading…
Cancel
Save