How do you structure your ReactJS component definitions?
- How do you order methods inside Component class definition? Some methods must be "implemented", others are your own, custom methods. How do you maximize readability?
- Do you name your handler in a specific way?
handleSomething
,somethingHandler
,onSomeEvent
. For example, to distinguish which handlers are attach to child components (e.g. list elements) and which are used by the component itself (for it's own markup). - What other rules do you follow when writing components?
- Do you use
ES6
orES7
features?
Edit: found out that yannickcr/eslint-plugin-react and airbnb/javascript have some of the answer: