highcharts / highcharts-react-native

Other
103 stars 79 forks source link

[Work around] for 2.1.2 with react-native-webview 10 #88

Closed horstleung closed 4 years ago

horstleung commented 4 years ago

beta-3 is buggy....

and I am using 2.1.2 before

After updating my project's webview to version 10, the chart become blank. after inspecting, here is my work around:

HighchartsReactive.js

// I don't know why it would imort modules/highcharts-more, so, I gave it a false
loadScripts('highcharts-more', function () {
....
}, redraw, false}
.............
...........
// ios need injectedJavaScriptBeforeContentLoaded while android need injectedJavaScript
<WebView
                ref = "webview"
                onMessage = {this.props.onMessage ? (event) => this.props.onMessage(event.nativeEvent.data) : {}}
                source={highchartsLayout}
                injectedJavaScript={Platform.OS === 'android' ? runFirst : undefined}
                injectedJavaScriptBeforeContentLoaded={Platform.OS === 'ios' ? runFirst : undefined}
                originWhitelist={["*"]}
                automaticallyAdjustContentInsets={true}
                allowFileAccess={true}
                javaScriptEnabled={true}
                domStorageEnabled={true}
                useWebKit={true}
                scrollEnabled={false}
                mixedContentMode='always'
                allowFileAccessFromFileURLs={true}
                startInLoadingState = {this.props.loader}
                style={this.props.webviewStyles}
            />

and moved css/style.css into index.html's head

sebastianbochan commented 4 years ago

Could you elaborate what kind of bugs have you in beta-3 ?

In he 3.0:

Im a little confused about the feedback.

horstleung commented 4 years ago

my changes are made on 2.1.2. Just for sharing my work around for someone facing the same problem.

I tried beta-3 this morning and it is not working. I haven't see the error log coz I'm rushing for my release. I would try it again later.

sebastianbochan commented 4 years ago

We just released the 3.0 version, so please test and let us know if it worked in your scenario, properly.

horstleung commented 4 years ago

great. will test in these days

horstleung commented 4 years ago

@sebastianbochan It looks fine with version 3.0.1. Is it necessary to copy files to Put the files (i.e. Folder: highcharts-layout and highcharts-files) ?

sebastianbochan commented 4 years ago

It should not be needed.

horstleung commented 4 years ago

ok thanks

horstleung commented 4 years ago

closed as 3.0 is released.