Skip to content
Snippets Groups Projects
Commit 1a3bc814 authored by David Baker's avatar David Baker
Browse files

clarify event handlers

parent afa6acc2
Branches
Tags
No related merge requests found
......@@ -151,7 +151,7 @@ React
<Foo onClick={function(ev) {doStuff();}}> // Bad
<Foo onClick={(ev) => {doStuff();}}> // Equally bad
<Foo onClick={this.doStuff}> // Better
<Foo onClick={this.onClick}> // Best
<Foo onClick={this.onFooClick}> // Best, if onFooClick would do anything other than directly calling doStuff
```
- Think about whether your component really needs state: are you duplicating
information in component state that could be derived from the model?
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment