Explicitly clarify naming policy for React event handler methods
See original GitHub issueThe ordering section implies that event handlers should be named onFoo
rather than handleFoo
per FB examples. Is this an explicit rule? If so, it would be nice to have it listed in either the “naming” or “methods” sections.
Issue Analytics
- State:
- Created 8 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Handy Naming Conventions for Event Handler Functions ...
Naming your handler functions follows a similar naming convention to the one for event handler attributes. Simply remember that there is a flow...
Read more >Handling Events - React
React events are named using camelCase, rather than lowercase. With JSX you pass a function as the event handler, rather than a string....
Read more >React onClick event handlers: A complete guide
Learn the basics of React's onClick event handler, including event listening, onClick buttons, synthetic events, custom events, and more.
Read more >How does react handle functions/callbacks passed to event ...
React makes use of Synthetic events. In case you are using a class based component you need to bind you function scope to...
Read more >Difference between HTML and React Event Handling
We are only suppose to pass the method name and nothing else. React can determine that it has to run this method. We...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m wondering if there’s been any changes here –
onFoo
,handleFoo
, “use an appropriate verb-based clause”, or something else, especially given that the rule set still includes sort-comp.Any updates here?