Skip to content

Commit 6846c10

Browse files
committed
Explain why not to prefix methods with underscores
1 parent 1541503 commit 6846c10

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

react/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -450,6 +450,7 @@
450450
```
451451
452452
- Do not use underscore prefix for internal methods of a React component.
453+
> 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.
453454
454455
```jsx
455456
// bad

0 commit comments

Comments
 (0)