Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Already Mounted. #895

Closed
nathanhack opened this issue Sep 30, 2023 · 1 comment
Closed

Already Mounted. #895

nathanhack opened this issue Sep 30, 2023 · 1 comment

Comments

@nathanhack
Copy link

nathanhack commented Sep 30, 2023

panic: {"line":"html.go:208","message":"appending child failed","tags":{"child":{},"index":3},"wrap":{"line":"html.go:263","message":"mounting element failed","tags":{"element":{}},"wrap":{"line":"component.go:278","message":"mounting component failed","tags":{"kind":3,"name":"*Node","reason":"already mounted"}}}}

I have a parent app.Compo with a list of sub-app.Compo's (*Node).

In the parent Render() I essentially have:

elems := []app.UI{}

//list of some stuff (app.ELem's)

//then add all the sub-app.Compo's

return app.Elem().Body( elems...)

But if the list of some stuff grows then I get the above panic.

@JulienLecoq
Copy link

If one of the child is already mounted somewhere in your website, you can't mount it another time. You have to create a new instance of this child to be able to mount it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants