You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
No-string-refs.md makes the distinction between valid and invalid use of refs:
Invalid:
var Hello = React.createClass({
componentDidMount: function() {
var component = this.refs.hello;
// ...do something with component
},
render: function() {
return <div ref="hello">Hello, world.</div>;
}
});
Valid:
var Hello = React.createClass({
componentDidMount: function() {
var component = this.hello;
// ...do something with component
},
render() {
return <div ref={c => this.hello = c}>Hello, world.</div>;
}
});
However, the valid method described produces another warning "react/jsx-no-bind". No-string-refs.md may need to be updated so as to illustrate how to properly use refs without either warning?
The text was updated successfully, but these errors were encountered:
No-string-refs.md makes the distinction between valid and invalid use of refs:
Invalid:
Valid:
However, the valid method described produces another warning "react/jsx-no-bind". No-string-refs.md may need to be updated so as to illustrate how to properly use refs without either warning?
The text was updated successfully, but these errors were encountered: