Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I agree with all of these changes. Code-style-wise, I prefer to call the actual handler implementations `handleFoo` as opposed to `onFoo`. It's a very small detail, but it makes code a little easier to sift through (as well as search/replace), because you always know that `onFoo` is a prop (whose implementation is foreign to the component) and `handleFoo` is a method (whose implementation is native to the component).


Not a bad idea. We would typically use _onClick for any component handler methods, so the _ would distinguish it. We have an internal transform that mangles anything in a module starting with _ so that it cannot be accessed outside.


I also prefix with _, if only to indicate what's private and what's API. Mind sharing your transform?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: