react-native-echarts
react-native-echarts copied to clipboard
关于webview的问题?WebView has been removed from React Native.
WebView has been removed from React Native.
WebView has been removed from React Native.
关于webview版本的问题,作者是否可以更新优化一下呢?
这个库作者已经好久不维护了,应该是放弃了。
我这里有两个解决方案。
一个是换另一个库https://github.com/supervons/react-native-echarts-pro ,作者是基于这个库重构的。
继续使用这个库的话,可以修改node_modules目录下,native-echarts目录中的源码。把所有从"react-native"导入的"WebView"组件换成import WebView from 'react-native-webview';
,从"react-native-webview"中导入。
RN新版0.57起,native-echarts里面的WebView可以添加useWebKit={true}属性来指定使用WKWebView
dont use this package , depricated !!
use it npm i react-native-echarts-pro now
for the solution of this question go through this path edit file .\node_modules\native-echarts\src\components\Echarts\index.js
import { WebView, View, StyleSheet, Platform } from 'react-native';
to=> import {View, StyleSheet, Platform } from 'react-native'; import {WebView} from 'react-native-webview';
issue solved