RN 刨坑之旅

2019-06-18  本文已影响0人  ios_wong

1、warnings: missing keys
组件列的每个组件需加上key

  let images = this.state.dataSource.map((value,i) => {
           return (
              <BannerImage dataModel={value} width={this.state.width} height={this.state.height} key={i} />
            );
        });

2、VirtualizedList: missing keys for items, make sure to specify a key property on each item or provide a custom keyExtractor.

keyExtractor = {(item, index) => index}

3、RN集成到原生项目,RNGestureHandlerModule报错;


image.png

在podfile中添加:
pod 'RNGestureHandler', :path => '../node_modules/react-native-gesture-handler'
然后执行 pod install

4、集成后Xcode报错,目录太长无法recursive
解决办法:修改Xcode中header research path改成non-recursive


image.png
上一篇 下一篇

猜你喜欢

热点阅读