Skip to content

ReactNative从0.47 升级到0.56遇到的问题 #1

Description

@CodingPapi

Gradle

babel

第三方依赖问题

  • Unable to resolve module react-native/Libraries/StyleSheet/normalizeColor from /home/supermario/Nodejs/test/fromScrach/Sinopec/node_modules/antd-mobile-rn/lib/segmented-control/segmented.android.js: Module react-native/Libraries/StyleSheet/normalizeColor does not exist in the Haste module map

    antd-mobile-rn 库使用了react-native弃用迁移的变量。最新版本的antd库就有问题,没法升级,我们会只有一个weldNew页面用到了SegmentedControl控件,可以考虑替换该控件。

运行时崩溃

  • react-native 的 自带Image控件

    运行时崩溃。未找到原因。自此卡住
    7.9号 灵感一现,继续
    resizeMode={Image.resizeMode.cover} 替换为 resizeMode="cover"

  • NavigationActions.reset undefined

    NavigationActions库版升级导致的不兼容, reset 方法被移到新的StackActions中了

资源重复问题

  • init一个新项目,一点一点把代码和依赖加进去,替换react.gardle,重新build,资源重复的问题消失了
  • 看到旧项目中冲突的资源是drawable文件夹中以src开头的一些图片,推测是之前版本编译自动生成。全部删除
  • 删除所有drawable-开头的资源文件夹,保留mipmap-开头的文件夹

遗留问题

  • 由于antd-mobile-rn库在0.56中崩溃,weldNew中,需要替换掉SegmentedControl控件

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions