Gage Hendy Ya Boy Gage Hendy Ya Boy -3 years ago 124
React JSX Question

External libraries in React

I am working on a site using react, and I need to install mojs, mojs-timeline, and mojs-curve-editor. None of these are npm packages, what is the best way to include them to be used within react?

I found this post that looks like it references a helpful article in React's documentation but it has been deleted I guess as it just redirects you to the tutorial page.

I can download the files, or source them externally, whatever is best for this case.

I've seen a lot of talk about using Webpack, but I'm not too familiar with it and my attempts at including it in the Webpack config have been unsuccessful.

Any and all help is appreciated!

Answer Source

You should be able to simply link them in your index.html file like so...

<script type="text/javascript" src="/static/path/to/file/or/cdn"></script>
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download