Require:
This allows us to have dynamically load module which isnt predefined or we can also conditionally load a module when we reuire it.
Ex: var Navitem =require ("./components/NavItem");
Imports:
We can use ES6 import to selectively load the pieces which we need and by doing this we can save memory.
import Navitem from("./components/NavItem);
require is in ES 5 and in ES 6 we make use of import
require is in ES 5 and in ES 6 we make use of import
No comments:
Post a Comment