RN SectionList 遇到 missing keys for items, make sure to specify a key property on each item 的 问题解决
2018-01-07 17:20
686 查看
最近在学习 RN 的 在控制台遇到
它警告我们每个item 要有不同的key
默认情况下每行都需要提供一个不重复的key属性。你也可以提供一个keyExtractor函数来生成key。
链接:https://www.jianshu.com/p/6302c4d48b97
它警告我们每个item 要有不同的key
默认情况下每行都需要提供一个不重复的key属性。你也可以提供一个keyExtractor函数来生成key。
把这个属性添加到 <SectionList/> 里面 keyExtractor = {this._extraUniqueKey} _extraUniqueKey(item ,index){ return "index"+index+item; }这是每个item要设置key, 同样每个子控件也不能放过, 一定要设置它的key, 要不然这个屎黄色一直伴着你 多烦~~~
链接:https://www.jianshu.com/p/6302c4d48b97
相关文章推荐
- maven 遇到failOnMissingWebXml有关问题解决方法:web.xml is missing and <failOnMissingWebXml> is set to true
- Unity2017 Unable to list target platforms.Please make sure the android sdk path is correct.问题解决!
- 学习strut时遇到的问题 - Unable to compile class for JSP 错误的解决过程。
- foobar2000使用cue文件播放时出现Unable to open item for playback (Object not found):的问题解决
- navicat for Mysql:2003 can't connect to mysql server on 'localhost'(10038)问题的解决方法
- 解决web.xml is missing and <failOnMissingWebXml> is set to true问题
- 解决Python2.7 连接MySQL数据库遇到'can't connect to MySQL server on 'localhost'(10061)'问题
- 安装Fedora时遇到unable to find any devices of the type needed for this installation type问题的解决
- Github遇到Permanently added the RSA host key for IP address '192.30.252.128' to the list of known host
- "Unable to compile template. Check the Errors list for details" 问题解决办法
- HOWTO install and setup Android NDK for Linux(Android NDK安装遇到的问题和解决方法)
- maven 遇到failOnMissingWebXml有关问题解决方法
- Druid中(*)druid property for user to setup问题的解决办法
- 安装新android studio时候碰到问题 unable to access Android SDK add-on list,解决
- 系统出现“NTLDR is missing press any key to restart”问题解决方案
- 今天使用PullToRefreshListView时遇到Item点击事件失效问题,特此记下解决办法
- 错误:*** -[NSUserDefaults setObject:forKey:]: attempt to insert non-property list object
- Hadoop on Mac with IntelliJ IDEA - 7 解决failed to report status for 600 seconds. Killing!问题
- 解决Niosii下载FLASH遇到的问题No EPCS layout data --- looking for section [EPCS-xxxxx]
- make: Nothing to be done for `all_modules'.问题解决