Module:
- If you mention type= " module", that file is considered a module.
- If any JavaScript file is an exportable function or content(variable, object) that is considered a module.
Import and export: it is used to access files from one file to another file. For this purpose, we have to use export and import concepts.
Export: Exports are classified into two types they are :
-
Default export
-
Named export.
Default export:
- It is used to export the components or objects from one file to another file.
- It is possible to customise the component names.
- We can export only one component.
Syntax: export default <component>
Example: export default login
Named export:
- It is used to export the components from one file to other files.
- It is not possible to customise the component names; you must and should use the same names.