function Component.__resolveUpdate(w,O,X)if config.internalTypeChecks then internalAssert(Type.of(w)==Type.StatefulComponentInstance,"\073\110\118\097\108\105\100 \117\115\101 \111\102 \096\095\095\114\101\115\111\108\118\101\085\112\100\097\116\101\096")end local G=w[InternalData]local m=G.virtualNode local v=G.reconciler local k=w.props local C=w.state if O==nil then O=k end if X==nil then X=C end if w.shouldUpdate~=nil then G.lifecyclePhase=ComponentLifecyclePhase.ShouldUpdate local m=w:shouldUpdate(O,X)if not m then G.lifecyclePhase=ComponentLifecyclePhase.Idle return false end end if w.willUpdate~=nil then G.lifecyclePhase=ComponentLifecyclePhase.WillUpdate w:willUpdate(O,X)end G.lifecyclePhase=ComponentLifecyclePhase.Render w.props=O w.state=X local r=m.instance:render()G.lifecyclePhase=ComponentLifecyclePhase.ReconcileChildren v.updateVirtualNodeWithRenderResult(m,m.hostParent,r)if w.didUpdate~=nil then G.lifecyclePhase=ComponentLifecyclePhase.DidUpdate w:didUpdate(k,C)end G.lifecyclePhase=ComponentLifecyclePhase.Idle return true end return Component
--[[
	Internal method used by __update to apply new props and state

	Returns true if the update was completed, false if it was cancelled by shouldUpdate
]]
function Component:__resolveUpdate(incomingProps, incomingState)
	if config.internalTypeChecks then
		internalAssert(Type.of(self) == Type.StatefulComponentInstance, "Invalid use of `__resolveUpdate`")
	end

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

	local oldProps = self.props
	local oldState = self.state

	if incomingProps == nil then
		incomingProps = oldProps
	end
	if incomingState == nil then
		incomingState = oldState
	end

	if self.shouldUpdate ~= nil then
		internalData.lifecyclePhase = ComponentLifecyclePhase.ShouldUpdate
		local continueWithUpdate = self:shouldUpdate(incomingProps, incomingState)

		if not continueWithUpdate then
			internalData.lifecyclePhase = ComponentLifecyclePhase.Idle
			return false
		end
	end

	if self.willUpdate ~= nil then
		internalData.lifecyclePhase = ComponentLifecyclePhase.WillUpdate
		self:willUpdate(incomingProps, incomingState)
	end

	internalData.lifecyclePhase = ComponentLifecyclePhase.Render

	self.props = incomingProps
	self.state = incomingState

	local renderResult = virtualNode.instance:render()

	internalData.lifecyclePhase = ComponentLifecyclePhase.ReconcileChildren
	reconciler.updateVirtualNodeWithRenderResult(virtualNode, virtualNode.hostParent, renderResult)

	if self.didUpdate ~= nil then
		internalData.lifecyclePhase = ComponentLifecyclePhase.DidUpdate
		self:didUpdate(oldProps, oldState)
	end

	internalData.lifecyclePhase = ComponentLifecyclePhase.Idle
	return true
end

return Component
