From 86c9f2fd1899624007a02f439d6f05b46efa710a Mon Sep 17 00:00:00 2001 From: Jordan Gensler Date: Sun, 13 Dec 2015 21:21:23 -0800 Subject: [PATCH] Removing file extensions. Fixing typos. --- react/README.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/react/README.md b/react/README.md index 8b3aa85358..2616738588 100644 --- a/react/README.md +++ b/react/README.md @@ -66,13 +66,13 @@ const reservationItem = ; ``` - **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'; @@ -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). @@ -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 { @@ -336,7 +336,7 @@ ```javascript // bad class extends React.Component { - createNavigation(){ + createNavigation() { // render stuff } render() { @@ -346,7 +346,7 @@ // good class extends React.Component { - renderNavigation(){ + renderNavigation() { // render stuff } render() {