Skip to content

Commit

Permalink
Removing file extensions. Fixing typos.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jordan Gensler committed Dec 14, 2015
1 parent 5a2d659 commit 86c9f2f
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions react/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,13 @@
const reservationItem = <ReservationCard />;
```

**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:
- **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:
```javascript
// bad
import Footer from './Footer/Footer.jsx';
import Footer from './Footer/Footer';
// bad
import Footer from './Footer/index.jsx';
import Footer from './Footer/index';
// good
import Footer from './Footer';
Expand Down Expand Up @@ -255,7 +255,7 @@
## Methods
- Bind event handlers for the render method in the constructor.
> Why? A bind call in a prop will create a brand new function on every single render.
> Why? A bind call in a the render path create a brand new function on every single render.
eslint rules: [`react/jsx-no-bind`](https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-bind.md).
Expand Down Expand Up @@ -292,13 +292,13 @@
- Do not use underscore prefix for internal methods of a React component.
```javascript
// bad
class extends React.Component {
React.createClass({
_onClickSubmit() {
// do stuff
}
},
// other stuff
}
});
// good
class extends React.Component {
Expand Down Expand Up @@ -336,7 +336,7 @@
```javascript
// bad
class extends React.Component {
createNavigation(){
createNavigation() {
// render stuff
}
render() {
Expand All @@ -346,7 +346,7 @@
// good
class extends React.Component {
renderNavigation(){
renderNavigation() {
// render stuff
}
render() {
Expand Down

0 comments on commit 86c9f2f

Please sign in to comment.