From 3b7dceab897709fe8243c605adea90ee771c49ff Mon Sep 17 00:00:00 2001
From: Markus Wüstenberg
Date: Wed, 5 May 2021 09:03:16 +0200
Subject: Streamline HTML element API (#66)
There were a lot of elements previously, like `Em`, `H1`, and a lot more, that took a string as the first argument previously. This was weird when you wanted to mix elements to output html like `…` or `
Something something something
`. gomponents is not an HTML validator, so I want people to be able to use elements however they please, also without text content.
This also means that all elements now have the same API.---
examples/simple/simple.go | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'examples/simple/simple.go')
diff --git a/examples/simple/simple.go b/examples/simple/simple.go
index a6877f5..93aa28f 100644
--- a/examples/simple/simple.go
+++ b/examples/simple/simple.go
@@ -42,7 +42,7 @@ func Page(p props) g.Node {
{Path: "/foo", Name: "Foo"},
{Path: "/bar", Name: "Bar"},
}),
- H1(p.title),
+ H1(g.Text(p.title)),
P(g.Textf("Welcome to the page at %v.", p.path)),
},
})
--
cgit 1.4.1