- Focus an Input that only accepts numerical values
- Enter some non-numeric text
- Focus back out
My pattern is fairly common when you pay attention to it.
I'm not arguing that you should always use it; that's why I didn't replicate OP’s example. It’s just a demonstration that most cases have a solution that describes the intention more accurately than a dependency array.
The remaining cases can be solved by the workaround from react.dev or a userland alternative.