onMount/onCleanup not based on when component is added-to/removed-from DOM #1167
Labels
good first issue
Good for newcomers
help wanted
Looking for assistance on this issue
solid
Related to core Solid
Describe the bug
If you store a component in a variable it runs onMount once the element is created, but not necessarily when it's mounted to the actual DOM. If this isn't fixable, might want to update the docs.
Similarly for onCleanup, once you're in this state the cleanup is based on the ancestors.
Your Example Website or App
https://playground.solidjs.com/anonymous/dbcc36b4-44e6-49ed-a7bf-50e376d71016
Steps to Reproduce the Bug or Issue
https://playground.solidjs.com/anonymous/dbcc36b4-44e6-49ed-a7bf-50e376d71016
https://playground.solidjs.com/anonymous/efd63022-a8c2-44fb-842f-51c474b4b959
Expected behavior
As a user, I'd expect onMount and onCleanup to run when the relevant component and elements are inserted into and removed from the DOM itself.
https://docs.solidjs.com/reference/lifecycle/on-mount (emphasis mine)
Screenshots or Videos
No response
Platform
All of them I'd assume
Additional context
No response
The text was updated successfully, but these errors were encountered: