javascriptreactjscreatejs

how to Include createjs library into reactjs project


Hi I am creating an app on reactjs, which is canvas based, It require Createjs library, I am new for Reactjs I am not getting perfect idea how do this so I tried 2 ways one is using NPM install and other one is I kept my js into one folder and tries to import from there but nothing works for me, here my code

way 1 with npm install,
import createjs from 'createjs';

way 2 import downloaded js file,
import createjs from '../assets/js/createjsmin';

randomly I tried
import * as createjs from '../assets/js/createjsmin';

but nothing works for me


Solution

  • I add relative path to index.html and got Createjs library code into componentWillMount() using window.createjs, dn't know but I feel it can work to add all ramdom libraries in react.