Uncaught Error: vecty: next child render must not equal previous child render
(did the child Render illegally return a stored render variable?)
If I understood well Vecty doesn't let you return stored variable on Render, you have to return a new element on each call.
Because Link and LinkWithParam accepts a content for the anchor, this content is stored inside the struct and so causes the Vecty error.
One fix could be to not use a component but just a wrapper around the anchor :
func Link(path string, content vecty.ComponentOrHTML) vecty.ComponentOrHTML {
return elem.Anchor(
vecty.Markup(
prop.Href(`javascript:;`),
event.Click(onClick).PreventDefault().StopPropagation(),
),
content,
)
}
// The fix is not complete...
But it's sad to not be able to use a component here...
WDYT?
If I understood well Vecty doesn't let you return stored variable on
Render, you have to return a new element on each call.Because
LinkandLinkWithParamaccepts a content for the anchor, this content is stored inside the struct and so causes the Vecty error.One fix could be to not use a component but just a wrapper around the anchor :
But it's sad to not be able to use a component here...
WDYT?