React框架开发问题总结
2016-11-23 16:42
661 查看
react-dom.js:18962 Warning: Unknown prop `col` on <td> tag. Remove this prop from the element. For details, see https://fb.me/react-unknown-prop in td (created by ListComponent) in tr (created by ListComponent) in table (created by ListComponent) in div (created by ListComponent) in ListComponent in div
解决办法:把col改成colSpan<td colSpan='6'>/td>
react-dom.js:18962 Warning: validateDOMNesting(...): <tr> cannot appear as a child of <table>. See ListComponent > table > tr. Add a <tbody> to your code to match the DOM tree generated by the browser.解决办法:<table>加增加子元素<tbody>
react-dom.js:18698 Uncaught Invariant Violation: Expected onClick listener to be a function, instead got type string解决办法:预计OnClick侦听是一个函数,而不是字符串类型了<span className="first" onClick="{this.handleFirst}">首页</span>改成<span className="first" onClick={this.handleFirst}>首页</span>
react.js:3801 Warning: Each child in an array or iterator should have a unique "key" prop. Check the render method of `ListComponent`. See https://fb.me/react-warning-keys for more information. in tr (created by ListComponent) in ListComponent in div
解决办法:在循环array或iterator时,要给循环的标签增加一个key值。[0,1].map((child, i) => { return ( <tr key={i}> <td>item.time</td>
</tr> ); })
react-dom.js:18698 Uncaught Invariant Violation: noData.render(): A valid React element (or null) must be returned. You may have returned undefined, an array or some other invalid object.翻译:return里面的元素不完整 可能返回了undefined或数组或其他非法对象 render: function() { let text; if (this.props.isShow) { text = (<div className="c999 f16">{this.props.text}</div>); } console.log(text); return ({text}); }解决办法:返回值应该包裹在一个元素内return (<div>{text}</div>);
react-dom.js:18109 Warning: Unknown DOM property readonly. Did you mean readOnly?警告:未知的DOM属性只读的。你的意思是只读的
in input (created by App)
in li (created by App)
in ul (created by App)
in div (created by App)
in App (created by App)
in App
readonly改成 readOnly
这些标准的属性是被支持的:
react-dom.js:18109 Warning: Failed form propType: You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set either `onChange` or `readOnly`. Check the render method of `App`.
input 的value属性要改成 defaultValue
解决办法:把col改成colSpan<td colSpan='6'>/td>
react-dom.js:18962 Warning: validateDOMNesting(...): <tr> cannot appear as a child of <table>. See ListComponent > table > tr. Add a <tbody> to your code to match the DOM tree generated by the browser.解决办法:<table>加增加子元素<tbody>
react-dom.js:18698 Uncaught Invariant Violation: Expected onClick listener to be a function, instead got type string解决办法:预计OnClick侦听是一个函数,而不是字符串类型了<span className="first" onClick="{this.handleFirst}">首页</span>改成<span className="first" onClick={this.handleFirst}>首页</span>
react.js:3801 Warning: Each child in an array or iterator should have a unique "key" prop. Check the render method of `ListComponent`. See https://fb.me/react-warning-keys for more information. in tr (created by ListComponent) in ListComponent in div
解决办法:在循环array或iterator时,要给循环的标签增加一个key值。[0,1].map((child, i) => { return ( <tr key={i}> <td>item.time</td>
</tr> ); })
react-dom.js:18698 Uncaught Invariant Violation: noData.render(): A valid React element (or null) must be returned. You may have returned undefined, an array or some other invalid object.翻译:return里面的元素不完整 可能返回了undefined或数组或其他非法对象 render: function() { let text; if (this.props.isShow) { text = (<div className="c999 f16">{this.props.text}</div>); } console.log(text); return ({text}); }解决办法:返回值应该包裹在一个元素内return (<div>{text}</div>);
react-dom.js:18109 Warning: Unknown DOM property readonly. Did you mean readOnly?警告:未知的DOM属性只读的。你的意思是只读的
in input (created by App)
in li (created by App)
in ul (created by App)
in div (created by App)
in App (created by App)
in App
readonly改成 readOnly
HTML 属性
这些标准的属性是被支持的:accept acceptCharset accessKey action allowFullScreen allowTransparency alt async autoComplete autoPlay cellPadding cellSpacing charSet checked classID className cols colSpan content contentEditable contextMenu controls coords crossOrigin data dateTime defer dir disabled download draggable encType form formAction formEncType formMethod formNoValidate formTarget frameBorder height hidden href hrefLang htmlFor httpEquiv icon id label lang list loop manifest marginHeight marginWidth max maxLength media mediaGroup method min multiple muted name noValidate open pattern placeholder poster preload radioGroup readOnly rel required role rows rowSpan sandbox scope scrolling seamless selected shape size sizes span spellCheck src srcDoc srcSet start step style tabIndex target title type useMap value width wmode
react-dom.js:18109 Warning: Failed form propType: You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set either `onChange` or `readOnly`. Check the render method of `App`.
input 的value属性要改成 defaultValue
相关文章推荐
- Android开发中使用开源框架的问题总结
- React-Native开发总结-html层面上的问题
- APICloud框架——总结一下最近开发APP遇到的一些问题
- APICloud框架——总结一下最近开发APP遇到的一些问题 (三)
- 使用Vue框架开发商城mall项目中所遇到的问题及技术点总结
- React-Native开发总结-原生APP层面上的问题
- React-Native开发总结-redux层面上的问题
- 某教育平台项目开发之--使用SSM框架开发过程遇到的问题总结
- APICloud框架——总结一下最近开发APP遇到的一些问题 (二)
- 基于mui前端框架开发APP问题总结
- Yii框架开发问题总结
- [转] PHP开发框架总结
- [转] PHP开发框架总结
- 总结最近项目开发中遇到的问题,希望对大家有所帮助!
- Eclipse3.3+CDT4.0.3+MinGW5.1.4搭建C/C++开发平台问题总结
- winpcap开发包使用中的问题总结
- GAE开发问题总结、GAE开发心得(我爱记账网-在线记账、网络记账、网上记账、家庭记账)
- C# 系统开发历程 经验总结及遇到问题 之 无法更新有效的 更新要求有效的 UpdateCommand
- 软件开发常见问题总结