diff --git a/docs/docs/04-core-concepts/01-components.md b/docs/docs/04-core-concepts/01-components.md index 442009e05..159534c45 100644 --- a/docs/docs/04-core-concepts/01-components.md +++ b/docs/docs/04-core-concepts/01-components.md @@ -66,6 +66,8 @@ Go code: ```templ package main +import "os" + type Data struct { message string } @@ -82,6 +84,31 @@ func main() { } ``` +It is also possible to initialize a struct and call it's component method inline. +```templ +package main +import "os" + +type Data struct { + message string +} + +templ (d Data) Method() { +