function ExternalEventConnection.render(G)return Roact.oneChild(G.props[Roact.Children])end function ExternalEventConnection.didMount(G)local l=G.props.event local A=G.props.callback G.connection=l:Connect(A)end function ExternalEventConnection.didUpdate(l,G)if l.props.event~=G.event or l.props.callback~=G.callback then l.connection:Disconnect()l.connection=l.props.event:Connect(l.props.callback)end end function ExternalEventConnection.willUnmount(G)G.connection:Disconnect()G.connection=nil end return ExternalEventConnection

function ExternalEventConnection:render()
	return Roact.oneChild(self.props[Roact.Children])
end

function ExternalEventConnection:didMount()
	local event = self.props.event
	local callback = self.props.callback

	self.connection = event:Connect(callback)
end

function ExternalEventConnection:didUpdate(oldProps)
	if self.props.event ~= oldProps.event or self.props.callback ~= oldProps.callback then
		self.connection:Disconnect()

		self.connection = self.props.event:Connect(self.props.callback)
	end
end

function ExternalEventConnection:willUnmount()
	self.connection:Disconnect()

	self.connection = nil
end

return ExternalEventConnection
