Skip to content

Commit

Permalink
Small grammar fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Sylphony authored Mar 27, 2017
1 parent 0e15272 commit ef1abd9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions conventions/08.closures-in-render.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Avoid passing new closures to subcomponents.
*
* Here’s why: every time the parent component renders, a new function is created and passed to the input.
* If the input were a React component, this would automatically trigger it to re-render, regardless of whether its other props have actually changed.
* If the input was a React component, this would automatically trigger it to re-render, regardless of whether its other props have actually changed.
* Reconciliation is the most expensive part of React. Don’t make it harder than it needs to be! Plus, passing a class method is easier to read, debug, and change.
*/

Expand All @@ -13,7 +13,7 @@ class Example extends Component {
type="text"
value={model.name}
// onChange={(e) => { model.name = e.target.value }}
// ^ Not this. Use the below:
// ^ Not this. Use the one below:
onChange={this.handleChange}
placeholder="Your Name"/>
);
Expand Down

0 comments on commit ef1abd9

Please sign in to comment.