function ExternalEventConnection.render(m)return Roact.oneChild(m.props[Roact.Children])end function ExternalEventConnection.didMount(m)local b=m.props.event local R=m.props.callback m.connection=b:Connect(R)end function ExternalEventConnection.didUpdate(b,m)if b.props.event~=m.event or b.props.callback~=m.callback then b.connection:Disconnect()b.connection=b.props.event:Connect(b.props.callback)end end function ExternalEventConnection.willUnmount(m)m.connection:Disconnect()m.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
