神坑react native之Cannot Add a child that doesn’t have a YogaNode to a parent with out a measure function

在react native最新版 0.50,遍历数据时在组件标签中插入数据,写法大致如下:

...<View style={[styles.flitem,{}]}>{item.key}</View>...

会报错:

Cannot Add a child that doesn't have a YogaNode to a parent with out a measure function

react native的一贯作风,凡是升级,必定整点幺蛾子(但升级也别太频繁了好不好~~~手动哭脸)

react native在国内刚火起来,没那么多资料可以查,百度就别指望了。搭梯子去谷歌,搜到了这里:https://github.com/facebook/react-native/issues/13243,里面网友parthgandhi7说的靠谱。解决方法是将变量放到Text组件中:

...<View style={[styles.flitem,{}]}><Text>{item.key}</Text></View>...
关于博主
骨灰级博客玩家
国内第一批90后网站站长/程序员
做过七年前端讲师
目前从事锦鲤观赏鱼电商行业
鱼贝贝锦鲤创始人
文章列表
1
Node.js中mongoose模块连接MongoDB数据库时提示(node:12580) DeprecationWarning: current URL string parser is deprecated, and will be removed in a future version. To use the new parser, pass option { useNewUrlParser: true } to MongoClient.connect.的解决方案
Node.js中mongoose模块连接MongoDB数据库时提示(node:12580) DeprecationWarning: current URL string parser is deprecated, and will be removed in a future version. To use the new parser, pass option { useNewUrlParser: true } to MongoClient.connect.的解决方案
2
换种超炫酷的姿势写代码,webstorm activate-power-mode插件安装及配置
换种超炫酷的姿势写代码,webstorm activate-power-mode插件安装及配置
3
Adobe系列软件Photoshop安装时提示“安装完成,下列产品的某些项目无法成功安装”错误的原因及解决方法
Adobe系列软件Photoshop安装时提示“安装完成,下列产品的某些项目无法成功安装”错误的原因及解决方法
4
程序员的进阶之路
程序员的进阶之路
5
3DsMax启动时一直卡在“正在启动 3Ds Max”界面的解决方法
3DsMax启动时一直卡在“正在启动 3Ds Max”界面的解决方法
最新评论
比比拉布
比比拉布
5月7日
太感谢了!!!!!!找了这么多的教程,只有你点出来了关键点——设计视图!!!!
Jake
Jake
3月7日
Halo 啊~麻烦更新下我的博客地址,原名:Jing Blog。麻烦更新如下: Jake Blog(后缀可以省略,也可以保留,看哪个风格适合) 网址:htt
评论于关于博主