Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
matrix-react-sdk
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GitHub Mirror
Matrix.org
matrix-react-sdk
Commits
1a3bc814
Commit
1a3bc814
authored
Jul 8, 2016
by
David Baker
Browse files
Options
Downloads
Patches
Plain Diff
clarify event handlers
parent
afa6acc2
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
code_style.md
+1
-1
1 addition, 1 deletion
code_style.md
with
1 addition
and
1 deletion
code_style.md
+
1
−
1
View file @
1a3bc814
...
...
@@ -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.on
Foo
Click}> // 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?
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment