title: React focus input for Modal/Dialog
body: <p>I am using React 14 and ES6/7. I have a modal Dialog that has a couple of inputs and when it opens, I want to focus on the first input. The dialog opens and closes fine and it's open property is toggled as expected (that code omitted for brevity below and because it's not really relevant) .</p>
  
  <p>I've tried autoFocus and componentDidUpdate and there are no console errors but nothing seems to give the input focus. What am I missing? I would expect componentDidUpdate to work, but it does not ...</p>
  
  <p>Dialog.jsx:</p>
  
  <pre><code>...
  
  componentDidUpdate(nextProps){
    console.log(this.props)
    if(this.props.open) { //&lt;-THIS IS TRUE AT THIS TIME!!!
      this.refs.emailInput.focus(); //&lt;-NO ERRORS HERE OR AT ALL, BUT NO FOCUS EITHER
    }
  }
  
  ...
  render() {
    return (
      &lt;form onSubmit={this.props.submitLogin} noValidate&gt;
        &lt;Dialog {...this.props}
          key="loginDialog"
          title="Login" actions={loginActions}&gt;
          &lt;input 
             ref="emailInput"
             key="emailField"
             placeholder="Email"
             type="email"
             autoFocus
          /&gt;
          &lt;input
            key="passwordField"
            placeholder="Password"
            type="password"
          /&gt;
        &lt;/Dialog&gt;
      &lt;/form&gt;
    )
  }
  
  ...
  </code></pre>
  
  <p>TIA!</p>