Open minhquankq opened 7 years ago
I had noticed this as well (in the code & delay) and am in favour of having the needed dependencies be baked into the eventual React Native bundle JS file (if possible), i.e. no extra network requests. It would also be of benefit for offline apps. I suspect this might come down to licences.
I've been playing a bit around with the code and I believe that jQuery is not needed. As far as I can tell the only thing jQuery is used for as of now is to register a document ready callback. As seen here:
$(function () {
Highcharts.stockChart('container', highchartConfigObject);
});
Without being 100% I think this could be replaced as such and no longer needing the jQuery dependency:
document.addEventListener("DOMContentLoaded", function() {
Highcharts.chart('container', highchartConfigObject);
});
Hi everyone! Does anyone have any hints on how to use offline bundles instead?
Update: Please ignore, will probably not work. See reply below.
@mmazzarolo One dirty way would be to modify the file react-native-ChartView.js
. There you could swap out line 38
<script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
with:
<script>put the contents of the https://code.jquery.com/jquery-2.1.4.min.js file here</script>
You would then do this for all the Githubissues.
When I inspect code of react-native-chartView.js, I saw that we use online libraries
that make the rendering slower. I'm not sure that are they cache or not, but the render delay 1s.
Can we use local libraries instead of online?