I m so confused with this. In react application we use import keyword to import something... but in express.js we use require keyword? why is that? please explain !
Asked
Active
Viewed 426 times
3
-
1*Generally* because React apps use Babel + Webpack to enable `import` functionality, and not all Express/server-side apps do the same. There's no reason they *can't*, though. – Dave Newton Jul 13 '21 at 19:08
-
I'm using express with `import` just fine. – Bergi Jul 13 '21 at 19:30
-
Oh thanks... I was just wondering why is that but now it is making sense. ! thanks :) – Aashish_Gaming Jul 14 '21 at 13:49