From 7e22857bc903f24823ae8c02affdd879714c3a26 Mon Sep 17 00:00:00 2001 From: Nathan Reiner Date: Thu, 8 Oct 2026 19:58:48 +0200 Subject: fix component attribute linking --- src/z/Component.zig | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/z/Component.zig b/src/z/Component.zig index 122975f..70d6e1d 100644 --- a/src/z/Component.zig +++ b/src/z/Component.zig @@ -105,17 +105,19 @@ pub fn exportLinks(self: *const Self) void { fn linkAttributes(self: *const Self, attributes: []const Attribute) []const Attribute { var linked: []const Attribute = &.{}; - for (attributes) |*attr| { + for (attributes) |attr| { if (attr.value.len > 0 and attr.value[0] == '@') { const event_handler = @field(self.link, attr.value[1..]); - const attribute: []const Attribute = &.{.{ + const attribute: Attribute = .{ .name = attr.name, .value = std.fmt.comptimePrint( "wasm_handle_event(\"export::{s}::{s}\", event, {})", .{ self.name, attr.value[1..], handlerNeedsEvent(event_handler) }, ), - }}; - linked = linked ++ attribute; + }; + linked = linked ++ .{attribute}; + } else { + linked = linked ++ .{attr}; } } return linked; -- cgit v1.2.3-70-g09d2