HarmonyOS react-native项目引用native-stack插件失败
react-native项目引用native-stack插件失败。
操作步骤:1、npm install react-native-screens@3.31.1。
2、在https://github.com/react-native-oh-library/react-navigation/releases下载react-native-oh-tpl-stack-6.4.0-0.0.3.tgz。
3、在https://github.com/react-native-oh-library/react-native-safe-area-context/releases下载react-native-oh-tpl-react-native-safe-area-context-4.7.4-0.1.4.tgz。
4、npm install @react-native-oh-tpl/native-stack@file:#指向第二步下载的react-native-oh-tpl-stack-6.4.0-0.0.3.tgz
npm install @react-native-oh-tpl/elements@file:#指向第二步下载的react-native-oh-tpl-stack-6.4.0-0.0.3.tgz
npm install @react-native-oh-tpl/react-native-safe-area-context@file:#指向第三步下载的react-native-oh-tpl-react-native-safe-area-context-4.7.4-0.1.4.tgz
5、harmony项目CMakeLists.txt、PackageProvider.cpp、RNPackagesFactory.ets、oh-package.json5中对react-native-safe-area-context做对应配置。
"@react-native-oh-tpl/native-stack”: "file:dependecies/react-native-oh-tpl-stack-6.4.0-0.6.3.tgz”这是stack的包,不是native-stack的包,react-native-oh-tpl-native-stack-6.9.26-0.0.1.tgz,这里才是native-stack,请重新配置下。