by throw1234651234 · 6y ago · 0 comments
2. Where are the closures and what's the necessity to use them?
2. onChange and onSave are both closures.
It isn’t technically necessary to use closures, but you need to find the correct setUsername from onChange, and since setUsername isn’t a global variable, closures are the natural and easy way to do it.
1. https://overreacted.io/react-as-a-ui-runtime/
Where else would you propose putting UI rendering logic?
Hooks have shown that Super Serious programming can also be comedy, which is pretty cool.
I dunno, the functions-or-bust crowd happily doing and championing manual OO machinery fiddling amuses me.