HarmonyOS项目里引入RN三方库react-native-webview报错

报错如下:

1 ERROR: ArkTS:ERROR File: /Users/xxx/Desktop/app/MyApplication/oh_modules/.ohpm/@react-native-oh-tpl+react-native-webview@omx0kqwv+tyoms+7rlqzyhbjnzd1vaglwsjtr6+bgyo=/oh_modules/@react-native-oh-tpl/react-native-webview/src/main/ets/RNCWebViewPackage.ts:35:12
Property 'RNCWebView' does not exist on type 'typeof import("/Users/xxx/Desktop/app/MyApplication/oh_modules/.ohpm/@rnoh+react-native-openharmony@b5r9+r64bsxgq3hdxnuvlfsm0jdsawyjurzfp74aw+u=/oh_modules/@rnoh/react-native-openharmony/generated/components/ts")'.

2 ERROR: ArkTS:ERROR File: /Users/xxx/Desktop/app/MyApplication/oh_modules/.ohpm/@react-native-oh-tpl+react-native-webview@omx0kqwv+tyoms+7rlqzyhbjnzd1vaglwsjtr6+bgyo=/oh_modules/@react-native-oh-tpl/react-native-webview/src/main/ets/RNCWebViewPackage.ts:35:47
Property 'RNCWebView' does not exist on type 'typeof import("/Users/xxx/Desktop/app/MyApplication/oh_modules/.ohpm/@rnoh+react-native-openharmony@b5r9+r64bsxgq3hdxnuvlfsm0jdsawyjurzfp74aw+u=/oh_modules/@rnoh/react-native-openharmony/generated/components/ts")'.

3 ERROR: ArkTS:ERROR File: /Users/xxx/Desktop/app/MyApplication/oh_modules/.ohpm/@react-native-oh-tpl+react-native-webview@omx0kqwv+tyoms+7rlqzyhbjnzd1vaglwsjtr6+bgyo=/oh_modules/@react-native-oh-tpl/react-native-webview/src/main/ets/WebViewBaseOperate.ets:29:29
Namespace '"/Users/xxx/Desktop/app/MyApplication/oh_modules/.ohpm/@rnoh+react-native-openharmony@b5r9+r64bsxgq3hdxnuvlfsm0jdsawyjurzfp74aw+u=/oh_modules/@rnoh/react-native-openharmony/generated/components/ts"' has no exported member 'RNCWebView'.

4 ERROR: ArkTS:ERROR File: /Users/xxx/Desktop/app/MyApplication/oh_modules/.ohpm/@react-native-oh-tpl+react-native-webview@omx0kqwv+tyoms+7rlqzyhbjnzd1vaglwsjtr6+bgyo=/oh_modules/@react-native-oh-tpl/react-native-webview/src/main/ets/WebViewBaseOperate.ets:32:33
Namespace '"/Users/xxx/Desktop/app/MyApplication/oh_modules/.ohpm/@rnoh+react-native-openharmony@b5r9+r64bsxgq3hdxnuvlfsm0jdsawyjurzfp74aw+u=/oh_modules/@rnoh/react-native-openharmony/generated/components/ts"' has no exported member 'RNCWebView'.

5 ERROR: ArkTS:ERROR File: /Users/xxx/Desktop/app/MyApplication/oh_modules/.ohpm/@react-native-oh-tpl+react-native-webview@omx0kqwv+tyoms+7rlqzyhbjnzd1vaglwsjtr6+bgyo=/oh_modules/@react-native-oh-tpl/react-native-webview/src/main/ets/RNCWebView.ets:50:37
Property 'RNCWebView' does not exist on type 'typeof import("/Users/xxx/Desktop/app/MyApplication/oh_modules/.ohpm/@rnoh+react-native-openharmony@b5r9+r64bsxgq3hdxnuvlfsm0jdsawyjurzfp74aw+u=/oh_modules/@rnoh/react-native-openharmony/generated/components/ts")'.

6 ERROR: ArkTS:ERROR File: /Users/xxx/Desktop/app/MyApplication/oh_modules/.ohpm/@react-native-oh-tpl+react-native-webview@omx0kqwv+tyoms+7rlqzyhbjnzd1vaglwsjtr6+bgyo=/oh_modules/@react-native-oh-tpl/react-native-webview/src/main/ets/RNCWebView.ets:85:29
Namespace '"/Users/xxx/Desktop/app/MyApplication/oh_modules/.ohpm/@rnoh+react-native-openharmony@b5r9+r64bsxgq3hdxnuvlfsm0jds
HarmonyOS
21h前
浏览
收藏 0
回答 1
待解决
回答 1
按赞同
/
按时间
put_get

参考引入文档:https://gitee.com/react-native-oh-library/usage-docs/blob/master/zh-cn/react-native-webview.md#https://gitee.com/link?target=https%3A%2F%2Fgithub.com%2Freact-native-oh-library%2Freact-native-webview%2Freleases

generated文件为codegen生成代码,请在rn项目的package.json文件配置codegen,在工程根目录下执行ohpm run dev后重试。

分享
微博
QQ
微信
回复
19h前
相关问题
HarmonyOS RN-原生引入RN三方编译异常
338浏览 • 1回复 待解决
HarmonyOS react-native-pdf三方问题
152浏览 • 1回复 待解决
HarmonyOS react-native-webview闪退问题
140浏览 • 1回复 待解决
react-native三方使用npm更新
1548浏览 • 1回复 待解决
HarmonyOS rn三方集成官网
682浏览 • 1回复 待解决
HarmonyOS RN三方的适配情况
713浏览 • 1回复 待解决
HarmonyOS RN三方适配方案
1浏览 • 0回复 待解决