You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 60ee711
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+13-14Lines changed: 13 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -40,7 +40,7 @@ Ignore this if you're specifically writing about ES5.
40
40
41
41
#### Don't use ES6 features when equivalent ES5 features have no downsides.
42
42
43
-
While we use ES6 in many places (`const` / `let`, classes, arrow functions), if the equivalent ES5 code is just as straightforward and readable, consider using it.
43
+
Remember that ES6 is still new to a lot of people. While we use it in many places (`const` / `let`, classes, arrow functions), if the equivalent ES5 code is just as straightforward and readable, consider using it.
44
44
45
45
In particular, you should prefer named `function` declarations over `const myFunction = () => ...` arrows for top-level functions. However, you *should* use arrow functions where they provide a tangible improvement (such as preserving `this` context inside a component). Consider both sides of the tradeoff when deciding whether to use a new feature.
46
46
@@ -49,27 +49,26 @@ In particular, you should prefer named `function` declarations over `const myFun
49
49
For example, **don't** write this:
50
50
51
51
```js
52
-
functionGreeting({isLoggedIn}) {
53
-
returndo {
54
-
if (isLoggedIn) {
55
-
<h1>Welcome back!</h1>;
56
-
} else {
57
-
<h1>Please sign in.</h1>;
58
-
}
52
+
classMyComponentextendsReact.Component {
53
+
state = {value:''};
54
+
handleChange= (e) => {
55
+
this.setState({value:e.target.value});
59
56
};
60
57
}
61
58
```
62
59
63
-
The [`do` expression syntax](https://github.com/tc39/proposal-do-expressions) is still experimental.
0 commit comments