ASP源码.NET源码PHP源码JSP源码JAVA源码DELPHI源码PB源码VC源码VB源码Android源码
当前位置:首页 >> 网页制作 >> web前端 >> React is changing a controlled input of type text to be uncontrolled

React is changing a controlled input of type text to be uncontrolled

来源:网络整理     时间:2016-05-31     关键词:

本篇文章主要介绍了"React is changing a controlled input of type text to be uncontrolled",主要涉及到方面的内容,对于web前端感兴趣的同学可以参考一下: React警告提示:warning.js:44 Warning: AddAddress is changing a controlled input of ty...

React警告提示:

warning.js:44 Warning: AddAddress is changing a controlled input of type text to be uncontrolled. 
Input elements should not switch from controlled to uncontrolled (or vice versa). 
Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://fb.me/react-controlled-components
Warning: <Component> is changing a uncontrolled input of type text to be controlled. Input 
elements should not switch from uncontrolled to controlled (or vice versa). Decide between 
using a controlled or uncontrolled input element for the lifetime of the component. More info: 
https://fb.me/react-controlled-components

问题分析:

React Input dom uncontrolled 导致报警告

问题解决:

Change

<input {...this.props.fields.firstName}/>
to

<input {...this.props.fields.firstName} value={this.props.fields.firstName.value || ''}/>



<input type="text" placeholder="请输入收货人姓名" value={form.name || '' } />

以上就介绍了React is changing a controlled input of type text to be uncontrolled,包括了方面的内容,希望对web前端有兴趣的朋友有所帮助。

本文网址链接:http://www.codes51.com/article/detail_1422073.html

相关图片

相关文章