question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Explicitly clarify naming policy for React event handler methods

See original GitHub issue

The 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:open
  • Created 8 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

4reactions
taioncommented, Jul 29, 2016

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.

0reactions
taioncommented, Jul 25, 2017

Any updates here?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found