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裏面

 

 

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