RN cannot add a child that doesnot have a YogoNode to a parent without a measure function!

react native 报错:cannot add a child that doesnot have a YogoNode to a parent without a measure function!

如图:

原因是:

1.该错误一般是因为render方法中注释语句写法不正确,render的return函数里面的注释语句应该写在 {} 里面,而不是直接 //,正确写法:{/*注释语句 */}

2.有字符串没有写在Text里面,字符串一定只能写在Text里面

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章