A library to control async libraries ;)
npm install react-async-resourcecharting_library.min.js & charting_library_datafeeds_udf.min.js into one of your react modules and you want it to be added when is needed.
js
const requiredScripts = [
"/js/charting_library/charting_library.min.js",
"/js/charting_library/charting_library_datafeeds_udf.min.js"
];
export default InjectScripts(...requiredScripts)(MyReactComponent);
`
Or you can also use react component like :
`jsx harmony
const url = "https://code.jquery.com/jquery-3.3.1.slim.min.js";
// you can also use array of urls, ex. url = ["url1", "url2", ...];
dontShowLoading={false} // optional param -> if you dont want to see loading set it to true
onLoad={onLoadEvent}> // optional param -> if you want some code run if all scripts are loaded
`
If you want to see a loading component when scripts are loading you can set window.scriptLoadingComponent :
`jsx harmony
class Loading extends React.Component {
render() {
return 'Scripts are Loading ...';
}
}
window.scriptLoadingComponent = Loading;
``