Skip to content

Commit ae69188

Browse files
author
Jordan Gensler
committed
Removing file extensions. Fixing typos.
1 parent 5c3137d commit ae69188

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

react/README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,14 @@
6868
const reservationItem = <ReservationCard />;
6969
```
7070

71-
**Component Naming**: Use the filename as the component name. For example, `ReservationCard.jsx` should have a reference name of `ReservationCard`. However, for root components of a directory, use `index.jsx` as the filename and use the directory name as the component name:
71+
- **Component Naming**: Use the filename as the component name. For example, `ReservationCard.jsx` should have a reference name of `ReservationCard`. However, for root components of a directory, use `index.jsx` as the filename and use the directory name as the component name:
7272

7373
```javascript
7474
// bad
75-
import Footer from './Footer/Footer.jsx';
75+
import Footer from './Footer/Footer';
7676
7777
// bad
78-
import Footer from './Footer/index.jsx';
78+
import Footer from './Footer/index';
7979
8080
// good
8181
import Footer from './Footer';
@@ -267,7 +267,7 @@
267267
268268
- Bind event handlers for the render method in the constructor.
269269
270-
> Why? A bind call in a prop will create a brand new function on every single render.
270+
> Why? A bind call in a the render path create a brand new function on every single render.
271271
272272
eslint rules: [`react/jsx-no-bind`](https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-bind.md).
273273
@@ -305,13 +305,13 @@
305305
306306
```javascript
307307
// bad
308-
class extends React.Component {
308+
React.createClass({
309309
_onClickSubmit() {
310310
// do stuff
311-
}
311+
},
312312
313313
// other stuff
314-
}
314+
});
315315
316316
// good
317317
class extends React.Component {
@@ -349,7 +349,7 @@
349349
```javascript
350350
// bad
351351
class extends React.Component {
352-
createNavigation(){
352+
createNavigation() {
353353
// render stuff
354354
}
355355
render() {
@@ -359,7 +359,7 @@
359359
360360
// good
361361
class extends React.Component {
362-
renderNavigation(){
362+
renderNavigation() {
363363
// render stuff
364364
}
365365
render() {

0 commit comments

Comments
 (0)