Skip to content

Commit

Permalink
render nil
Browse files Browse the repository at this point in the history
  • Loading branch information
Gardego5 committed Sep 28, 2024
1 parent d84950b commit 08ee35b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions fragment.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ type HTMLComponent interface{ Render() HTMLElement }

func Render(w io.Writer, child any) (int64, error) {
switch child := child.(type) {
case nil:
return 0, nil
case HTMLComponent:
return child.Render().WriteTo(w)
case HTMLElement:
Expand Down

0 comments on commit 08ee35b

Please sign in to comment.