[Work around] for 2.1.2 with react-native-webview 10
horstleung opened this issue · 8 comments
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
Could you elaborate what kind of bugs have you in beta-3
?
In he 3.0:
- styles are included in the
index.html
. - we also do not use the
loadScripts
but getScript function.
Im a little confused about the feedback.
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.
We just released the 3.0 version, so please test and let us know if it worked in your scenario, properly.
great. will test in these days
@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)
?
It should not be needed.
ok thanks
closed as 3.0 is released.