Browse Source

Explain arbitrariness of ref name in callback (#8913)

* Explain arbitrariness of ref name in callback 

The sample code was confusing because it's not clear that "textInput" in this.textInput is an arbitrary name for the ref.

* Tweak wording
main
Omid Hezaveh 8 years ago
committed by Dan Abramov
parent
commit
62c86a65a9
  1. 2
      docs/refs-and-the-dom.md

2
docs/refs-and-the-dom.md

@ -33,7 +33,7 @@ class CustomTextInput extends React.Component {
render() { render() {
// Use the `ref` callback to store a reference to the text input DOM // Use the `ref` callback to store a reference to the text input DOM
// element in this.textInput. // element in an instance field (for example, this.textInput).
return ( return (
<div> <div>
<input <input

Loading…
Cancel
Save