0

I start a new project in React 17, and using create-react-app.

Now i have to import some js and css files into the project ,but the js file is write like this :

(function(b){

  var JGOcx = { ... },
      JGTimeOut = { ... },
   
    ....

}(window);

I don't think this file i can easily using in a React project,I just want to use a "JGOcx" object , what should I do ?

wait for answers ...

YZ Shin
  • 1
  • 1
  • Notice the argument to the function is `window`, meaning this code will sooner or later define global variables accessible from anywhere, so just `import "file.js";` and pretend the exposed variables are exposed because they're exposed. – code Mar 08 '22 at 03:13
  • Not possible to any reasonable extent given the code in your question – CertainPerformance Mar 08 '22 at 03:15

0 Answers0