在react的componentDidMount中触发input框的focus无效是为什么?

用react做的微信端页面,想达到的效果是在页面加载后input框自动获得焦点能够弹出移动端的键盘,所以在componentDidMount中触发input框的focus,但是无效是怎么回事?

componentDidMount: function () {    var that = this;
    React.findDOMNode(this.refs.password).focus();    
}


蝴蝶不菲
浏览 1017回答 1
1回答
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JavaScript