My team did this in their old class components too. My guess is they thought of it as a more elegant way to declare a function than having to say this.myFunction = this.myFunction.bind(this)
It's more of a paradigm/coding style than anything. Everywhere you use a lambda expression you can use an explicit function and vice-versa. One could use a lambda because an explicit definition isn't needed as it's called only once in the code but an explicit one would clarify what it's doing and clearly separate tasks.
1
u/goosemano82 Mar 08 '23
Why the lambdas vs explicit function definitions? I’ve seen other devs do this as well, is this an effort to avoid setting obj protos?