diff --git a/redwood-treehouse-guest/src/jsMain/kotlin/app/cash/redwood/treehouse/ProtocolBridgeJs.kt b/redwood-treehouse-guest/src/jsMain/kotlin/app/cash/redwood/treehouse/ProtocolBridgeJs.kt index 916e73129b..8961fcea84 100644 --- a/redwood-treehouse-guest/src/jsMain/kotlin/app/cash/redwood/treehouse/ProtocolBridgeJs.kt +++ b/redwood-treehouse-guest/src/jsMain/kotlin/app/cash/redwood/treehouse/ProtocolBridgeJs.kt @@ -143,11 +143,15 @@ internal class FastGuestProtocolAdapter( value.forEach { element -> val (tag, serializer) = widgetSystemFactory.modifierTagAndSerializationStrategy(element) - val value = when { - serializer == null -> null - else -> json.encodeToDynamic(serializer, element) + when { + serializer != null -> { + val value = json.encodeToDynamic(serializer, element) + elements.push(js("""[tag,value]""")) + } + else -> { + elements.push(js("""[tag]""")) + } } - elements.push(js("""[tag,value]""")) } val id = id