Skip to content

Commit

Permalink
fix: issue where components inside components doesn't render
Browse files Browse the repository at this point in the history
  • Loading branch information
alindesign committed May 25, 2020
1 parent eb0e732 commit f4af192
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions render.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,7 @@ func render(component *Element, ctx *Context) (string, error) {
var errChunk error

if c != nil {
if IsComponent(c) {
chunk, errChunk = renderElement(renderComponent(c, ctx), ctx)
} else {
chunk, errChunk = renderElement(c, ctx)
}
chunk, errChunk = renderElement(c, ctx)
}

if errChunk != nil {
Expand All @@ -108,6 +104,10 @@ func render(component *Element, ctx *Context) (string, error) {
}

func renderElement(element interface{}, ctx *Context) (string, error) {
if IsComponent(element) {
return renderElement(renderComponent(element, ctx), ctx)
}

switch el := element.(type) {
case *Element:
return render(el, ctx)
Expand Down

0 comments on commit f4af192

Please sign in to comment.