counterexample -> antipattern

This commit is contained in:
Ben Alpert
2015-07-20 08:28:53 -07:00
parent 411cba9029
commit 2bcc761667
2 changed files with 3 additions and 3 deletions

View File

@@ -129,7 +129,7 @@ Since this method describes the view at any point in time, the value of the text
In HTML, the value of `<textarea>` is usually set using its children:
```html
<!-- counterexample: DO NOT DO THIS! -->
<!-- antipattern: DO NOT DO THIS! -->
<textarea name="description">This is the description.</textarea>
```

View File

@@ -48,7 +48,7 @@ Notice how, in this example, we want to "tell" the input something - something t
This means that you should never "hold onto" something that you return from `render()` and then expect it to be anything meaningful.
```javascript
// counterexample: DO NOT DO THIS!
// antipattern: This won't work.
render: function() {
var myInput = <input />; // I'm going to try to call methods on this
this.rememberThisInput = myInput; // input at some point in the future! YAY!
@@ -61,7 +61,7 @@ This means that you should never "hold onto" something that you return from `ren
}
```
In this counterexample, the `<input />` is merely a *description* of an `<input />`. This description is used to create a *real* **backing instance** for the `<input />`.
In this example, the `<input />` is merely a *description* of an `<input />`. This description is used to create a *real* **backing instance** for the `<input />`.
So how do we talk to the *real* backing instance of the input?