Skip to content

Commit

Permalink
Explain why not to prefix methods with underscores
Browse files Browse the repository at this point in the history
  • Loading branch information
ttmarek committed Aug 21, 2016
1 parent f1fedfa commit 5bd2769
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions react/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,7 @@
```
- Do not use underscore prefix for internal methods of a React component.
> Why? As Doug Crockford writes: "Do not use _ *underbar* as the first or last character of a name. It is sometimes intended to indicate privacy, but it does not actually provide privacy. If privacy is important, use closure. Avoid conventions that demonstrate a lack of competence." Source - http://javascript.crockford.com/code.html.
```jsx
// bad
Expand Down

0 comments on commit 5bd2769

Please sign in to comment.