TradingPal / react-native-highcharts

📈 Add Highcharts charts to react-native app for IOS and Android
https://github.com/TradingPal/react-native-highcharts
256 stars 158 forks source link

WebView has been removed from React Native. #112

Open nwilcox9 opened 4 years ago

nwilcox9 commented 4 years ago

I recently upgraded from React Native v59 to v61. Now I get this error when I try to use ChartView:

Invariant Violation: WebView has been removed from React Native. It can now be installed and imported from 'react-native-webview' instead of 'react-native'. See https://github.com/react-native-community/react-native-webview

I had noticed the warnings before I upgraded (mentioned here). I'm going to change the import in my code, but hope this can get fixed eventually!

nwilcox9 commented 4 years ago

I made the following edits to react-native-highcharts.js to make it work:

import {
    AppRegistry,
    StyleSheet,
    Text,
    View,
    // WebView,
    Image,
    Dimensions
} from 'react-native';

// add
import { WebView } from 'react-native-webview';

and

    render() {
    ...
              <WebView
                  // onLayout={this.reRenderWebView}
                  onLayout={this.reRenderWebView.bind(this)}
    ...
    };
abadfish commented 4 years ago

Can the maintainers update this library with the above change?

socrypto commented 4 years ago

For anyone who has this issue (@abadfish, @nwilcox9 etc) maintainers don't seem to be around anymore. I've rewritten this library (which happened to be a mess) which I will be actively maintaining and I will be working on further optimisations/new features. Feel free to check it out here. I've made sure the API is the same so should just be a question of installing react-native-highcharts-wrapper and updating the import (adding -wrapper).

guy-shahine commented 4 years ago

It looks like the highcharts team released this repo https://github.com/highcharts/highcharts-react-native