News for hackers. Stuff that matters.
Re:Optimizing React Rendering by abritinthebay on Thursday May 25, 2017 @03:31PM (#14419514)
Right, I just used `props.bar` in that example, you're right - it would be a bad idea to do so unless it was some kind of initializing prop (common with state-based stuff).

> The interface is the same.

Huh? foo(event) is different from foo(bar, event) and if your function is only ever going to be called with the former (ie - any dom event handler) and you want the latter... it's absolutely useful.

Re:Optimizing React Rendering by aidos on Thursday May 25, 2017 @04:19PM (#14419835)
I rather meant the interface between the partially applied foo and the version of foo that plucks bar from props when it's called.

Anyway, I see what you mean and it's a perfectly reasonable thing to do. Doesn't solve the original issue that was being discussed though :-)