【发布时间】:2015-07-07 18:00:21
【问题描述】:
所以我想做的是将用户名字段的值重置为'' 并关注它(当我收到从服务器发回的错误时)。
// get the form ref
var form = this.refs.loginForm.getForm();
// reset username field value (this actually gets updated if i check
// it in the console but the UI won't re-render
form.updateData({username: ''}, {validate: false})
// focus the username input (ofc doesnt work at all)
form.fields.username.focus();
【问题讨论】:
标签: javascript reactjs newforms