mirror of
https://github.com/reactjs/react.dev.git
synced 2026-02-25 23:05:23 +00:00
Update refs-and-the-dom.md (#8250)
Since a lot of projects use [airbnb eslint config](https://www.npmjs.com/package/eslint-config-airbnb) where [this rule](http://eslint.org/docs/rules/no-return-assign) is enabled (and its a good rule) some people might get confused when they are trying this out in their project.
This commit is contained in:
committed by
Kevin Lacker
parent
0087b527af
commit
10733f084a
@@ -38,7 +38,7 @@ class CustomTextInput extends React.Component {
|
||||
<div>
|
||||
<input
|
||||
type="text"
|
||||
ref={(input) => this.textInput = input} />
|
||||
ref={(input) => { this.textInput = input; }} />
|
||||
<input
|
||||
type="button"
|
||||
value="Focus the text input"
|
||||
@@ -65,7 +65,7 @@ class AutoFocusTextInput extends React.Component {
|
||||
render() {
|
||||
return (
|
||||
<CustomTextInput
|
||||
ref={(input) => this.textInput = input} />
|
||||
ref={(input) => { this.textInput = input; }} />
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -86,7 +86,7 @@ function CustomTextInput(props) {
|
||||
<div>
|
||||
<input
|
||||
type="text"
|
||||
ref={(input) => textInput = input} />
|
||||
ref={(input) => { textInput = input; }} />
|
||||
<input
|
||||
type="button"
|
||||
value="Focus the text input"
|
||||
|
||||
Reference in New Issue
Block a user