function Component.__resolveUpdate(X,g,E)if config.internalTypeChecks then internalAssert(Type.of(X)==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 b=X[InternalData]local l=b.virtualNode local z=b.reconciler local O=X.props local Y=X.state if g==nil then g=O end if E==nil then E=Y end if X.shouldUpdate~=nil then b.lifecyclePhase=ComponentLifecyclePhase.ShouldUpdate local l=X:shouldUpdate(g,E)if not l then b.lifecyclePhase=ComponentLifecyclePhase.Idle return false end end if X.willUpdate~=nil then b.lifecyclePhase=ComponentLifecyclePhase.WillUpdate X:willUpdate(g,E)end b.lifecyclePhase=ComponentLifecyclePhase.Render X.props=g X.state=E local A=l.instance:render()b.lifecyclePhase=ComponentLifecyclePhase.ReconcileChildren z.updateVirtualNodeWithRenderResult(l,l.hostParent,A)if X.didUpdate~=nil then b.lifecyclePhase=ComponentLifecyclePhase.DidUpdate X:didUpdate(O,Y)end b.lifecyclePhase=ComponentLifecyclePhase.Idle return true end return Component

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
