The basic idea is that if you need some kind of a value that can be derived from props in a pure function (a function where, given the same inputs, the output will always be the same), and if that computation is not too expensive. It’s better to not store that value in state at all.
Most standard event handlers (that I’m aware of) receive an object as the only parameter. If you need anything from the component’s props or state, if the function is bound in the constructor, it will have access to this.props and this.state.
If, though you must have multiple parameters, a function that is bound using…
Personally, I like to use defaultProps because it goes hand in hand with propTypes. I nearly always include propTypes definitions for my components, as it makes them very self-documenting. defaultProps, just seems to be a natural extension of that convention to me. But really, there’s nothing wrong with your approach (and it is much less verbose ).
Congrats on your success with UI Garage. This really is a fantastic resource. I’ve added it to my new tab icon list and plan to be coming back often. Can’t wait to see your project continue to flourish. Great work man!
Thank you for this. As a fellow developer/designer who has been going through a brutal phase of creative block (and/or depression), I really appreciate what you’re saying here. I’m super-hungry right now, but when I get back to my computer I’m going just start mashing out whatever words or partial ideas come to my head. Maybe that’ll get me going. Thanks again for sharing your insight.