react-dom.js:18962Warning:Unknownprop`col`on<td>tag.Removethispropfromtheelement.Fordetails,see
https://fb.me/react-unknown-prop
intd(createdbyListComponent)
intr(createdbyListComponent)
intable(createdbyListComponent)
indiv(createdbyListComponent)
inListComponent
indiv
解决办法:把col改成colSpan
<tdcolSpan='6'>/td>
react-dom.js:18962Warning:validateDOMNesting(...):<tr>cannotappearasachildof<table>.SeeListComponent>table>tr.Adda<tbody>toyourcodetomatchtheDOMtreegeneratedbythebrowser.
react-dom.js:18698UncaughtInvariantViolation:ExpectedonClicklistenertobeafunction,insteadgottypestring
<spanclassName="first"onClick="{this.handleFirst}">首页</span>
改成
<spanclassName="first"onClick={this.handleFirst}>首页</span>
react.js:3801Warning:Eachchildinanarrayoriteratorshouldhaveaunique"key"prop.Checktherendermethodof`ListComponent`.See
https://fb.me/react-warning-keysformoreinformation.
intr(createdbyListComponent)
inListComponent
indiv
[0,1].map((child,i)=>{
return(
<trkey={i}>
<td>item.time</td>
</tr>
);
})
react-dom.js:18698UncaughtInvariantViolation:noData.render():AvalidReactelement(ornull)mustbereturned.Youmayhavereturnedundefined,anarrayorsomeotherinvalidobject.
翻译:
return里面的元素不完整 可能返回了undefined或数组或其他非法对象
render:function(){
lettext;
if(this.props.isShow){
text=(<divclassName="c999f16">{this.props.text}</div>);
}
console.log(text);
return({text});
}
解决办法:返回值应该包裹在一个元素内
return(<div>{text}</div>);