function Component.__unmount(H)if config.internalTypeChecks then internalAssert(Type.of(H)==Type.StatefulComponentInstance,"\073\110\118\097\108\105\100 \117\115\101 \111\102 \096\095\095\117\110\109\111\117\110\116\096")end local e=H[InternalData]local d=e.virtualNode local s=e.reconciler if H.willUnmount~=nil then e.lifecyclePhase=ComponentLifecyclePhase.WillUnmount H:willUnmount()end for H,e in pairs(d.children)do s.unmountVirtualNode(e)end end
--[[
	Internal method used by the reconciler to clean up any resources held by
	this component instance.
]]
function Component:__unmount()
	if config.internalTypeChecks then
		internalAssert(Type.of(self) == Type.StatefulComponentInstance, "Invalid use of `__unmount`")
	end

	local internalData = self[InternalData]
	local virtualNode = internalData.virtualNode
	local reconciler = internalData.reconciler

	if self.willUnmount ~= nil then
		internalData.lifecyclePhase = ComponentLifecyclePhase.WillUnmount
		self:willUnmount()
	end

	for _, childNode in pairs(virtualNode.children) do
		reconciler.unmountVirtualNode(childNode)
	end
end
