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 ...

2
  • 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. Commented Mar 8, 2022 at 3:13
  • Not possible to any reasonable extent given the code in your question Commented Mar 8, 2022 at 3:15

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.