title: ReactJS input does not get focus
body: <p>Here's my code for the parent component (FundLogo):</p>
  
  <pre><code>var FundLogo = React.createClass({
  getInitialState: function() {
      return { editing: false, img: "img/xxx.gif" };
  },
  onClick: function() {
      this.setState({ editing: true });
  },
  onBlur: function(newImg) {
      this.setState({ editing: false, img: newImg});
  },
  render: function() {
      return(
          &lt;div className="banner_holder adj_height"&gt;
              {
                  this.state.editing ?
                      &lt;FundEditLogoBox onBlur={ this.onBlur } /&gt; :
                      &lt;img id="fund_logo" src={ this.state.img } onClick={ this.onClick } alt="finvesco logo" /&gt;
              }
          &lt;/div&gt;
      );
  }
  });
  </code></pre>
  
  <p>And here is the one for the child component (FundEditLogoBox):</p>
  
  <pre><code>var FundEditLogoBox = React.createClass({
  componentDidMount: function() {
      this.refs.editLogoBox.getDOMNode().focus();
      alert("Focus is on: " + document.activeElement);
  },
  onBlur: function() {
    this.props.onBlur(this.refs.editLogoBox.getDOMNode().value);
  },
  render: function() {
      return (
          &lt;div&gt;
              &lt;input type="file" onBlur={ this.onBlur } accept="image/*" ref="editLogoBox" /&gt;
          &lt;/div&gt;
      );
  }
  });
  </code></pre>
  
  <p>Basically what my code is supposed to do: </p>
  
  <ol>
  <li>Show an image in a container</li>
  <li>When the image is clicked an upload button is shown in the container instead of the image.</li>
  <li>If you click outside the upload button (input), without choosing an image to upload, the previous image is shown instead of the upload button.</li>
  </ol>
  
  <p>The problem I have is that the input (from the child component) does not get any focus when it gets mounted. I have to click on it to obtain focus. Furthermore, the alert shows </p>
  
  <blockquote>
    <p>"Focus is on: [object HTMLBodyElement]"</p>
  </blockquote>
  
  <p>I looked for similar issues everywhere on the web but nothing worked, and unlike other issues it does not seems it's a "re-rendering" problem...
  Thanks for your help!</p>