Refs cleanup when element unmounts

I would have thought the ref update back to "undefined" oncethe element unmounts the same way it updates when the element is created anew. Like is there a way that I can know based on the ref signal, that the element no longer actually exists? Playground:
Solid Playground
Quickly discover what the solid compiler will generate from your JSX template
5 Replies
refs are not reset back to undefined unfortunately So no way to gain that knowledge with refs alone
thetarnav2y ago
You can call onCleanup inside the ref callback though
@thetarnav not sure i understand completely, what is the ref callback here? 😅
ah i think i get it. Like this i suppose
Want results from more Discord servers?
Add your server
More Posts