PureComponent.extend=Component.extend function PureComponent.shouldUpdate(m,f,G)if G~=m.state then return true end if f==m.props then return false end for f,G in pairs(f)do if m.props[f]~=G then return true end end for G,m in pairs(m.props)do if f[G]~=m then return true end end return false end return PureComponent
-- When extend()ing a component, you don't get an extend method.
-- This is to promote composition over inheritance.
-- PureComponent is an exception to this rule.
PureComponent.extend = Component.extend

function PureComponent:shouldUpdate(newProps, newState)
	-- In a vast majority of cases, if state updated, something has updated.
	-- We don't bother checking in this case.
	if newState ~= self.state then
		return true
	end

	if newProps == self.props then
		return false
	end

	for key, value in pairs(newProps) do
		if self.props[key] ~= value then
			return true
		end
	end

	for key, value in pairs(self.props) do
		if newProps[key] ~= value then
			return true
		end
	end

	return false
end

return PureComponent
