Skip to content

Instantly share code, notes, and snippets.

@davidgilbertson
Last active August 18, 2017 10:13
Show Gist options
  • Select an option

  • Save davidgilbertson/4602e62582f2dc4a05f177af7bb0e35a to your computer and use it in GitHub Desktop.

Select an option

Save davidgilbertson/4602e62582f2dc4a05f177af7bb0e35a to your computer and use it in GitHub Desktop.

Revisions

  1. davidgilbertson renamed this gist Feb 26, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion App-focus-child.jsx → SignInModal-focus-child.jsx
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    class SignInPage extends React.Component {
    class SignInModal extends Component {
    componentDidMount() {
    this.InputComponent.focus();
    }
  2. davidgilbertson created this gist Feb 25, 2017.
    16 changes: 16 additions & 0 deletions App-focus-child.jsx
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,16 @@
    class SignInPage extends React.Component {
    componentDidMount() {
    this.InputComponent.focus();
    }

    render() {
    return (
    <div>
    <label>User name: </label>
    <Input
    ref={comp => { this.InputComponent = comp; }}
    />
    </div>
    )
    }
    }