function ExternalEventConnection.render(A)return Roact.oneChild(A.props[Roact.Children])end function ExternalEventConnection.didMount(A)local r=A.props.event local t=A.props.callback A.connection=r:Connect(t)end function ExternalEventConnection.didUpdate(r,A)if r.props.event~=A.event or r.props.callback~=A.callback then r.connection:Disconnect()r.connection=r.props.event:Connect(r.props.callback)end end function ExternalEventConnection.willUnmount(A)A.connection:Disconnect()A.connection=nil end return ExternalEventConnection
--[[
	Render the child component so that ExternalEventConnections can be nested like so:

		Roact.createElement(ExternalEventConnection, {
			event = UserInputService.InputBegan,
			callback = inputBeganCallback,
		}, {
			Roact.createElement(ExternalEventConnection, {
				event = UserInputService.InputEnded,
				callback = inputChangedCallback,
			})
		})
]]
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
