Skip to content

Commit 4ed93ee

Browse files
committed
Fix counter example to use Component return type
- Add (Component) return type to App() and Counter() functions - Ensures proper component generation with constructors and render methods
1 parent b912c99 commit 4ed93ee

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

examples/counter/app.gx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package main
22

33
import "strconv"
44

5-
func App() {
5+
func App() (Component) {
66
counter := make(chan int, 10)
77

88
Div(Class("app-container")) {

examples/counter/counter.gx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package main
22

3-
func Counter(counterChannel chan int) {
3+
func Counter(counterChannel chan int) (Component) {
44
Div(Class("counter-display")) {
55
Span(Class("counter-value")) {
66
`Counter: {<-counterChannel}`

0 commit comments

Comments
 (0)