I have imports at the top of JavaScript file (React.js):
import Home from "./Home";
import Login from "./Login";
import Dashboard from "./Dashboard";
...
And I want to 'automatic' this process with loop
let arr = [Home];
for (let i=0; i<arr.length; i++) {
import Home from "./Home";
}
But got this error: 'import' and 'export' may only appear at the top level
Can I do this in another way?