edit: just to add, they still do lots of outside stuff, but it's not like before.
Rules and limits are important and I agree the screen offers quicker gratification, so we as parents must set and enforce those rules.
That said, this changes the subject a bit, as we were talking about learning to code.
That's empathically not an instant gratification and we should not equate time spent in front of screen with time spent learning, expanding understanding of logic, cause and effect, structure, etc. And while kids are happy to spend hours gaming, I haven't seen many (in my social circle) that would be happy spending hours debugging some Python, Lua or Sketch code.
Presumably the alternative to teaching them programming, is spending time with them some other way.