Browse Source

Renamed ref in example

main
Brian Vaughn 7 years ago
parent
commit
f14f1477d5
  1. 6
      examples/16-3-release-blog-post/create-ref-example.js

6
examples/16-3-release-blog-post/create-ref-example.js

@ -1,14 +1,14 @@
class MyComponent extends React.Component {
// highlight-next-line
divRef = React.createRef();
inputRef = React.createRef();
render() {
// highlight-next-line
return <input type="text" ref={this.divRef} />;
return <input type="text" ref={this.inputRef} />;
}
componentDidMount() {
// highlight-next-line
this.divRef.current.focus();
this.inputRef.current.focus();
}
}

Loading…
Cancel
Save