11 - Default Export VS Named Export

You might also like

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 6

PART-11

DEFAULT EXPORT
VS
NAMED EXPORT REACT
PRESENTER: MOHAMMAD ADIL
Adil Named Export
Adil
CHILD Doctor

Default Export
Adil
Chotay Munna
Baby
CHILD Doctor
App Named Export
App
Component Index.js

Default Export
App
Comp New
MyApp
Component Index.js
Default Export Vs Named Export REACT

• ES6 provides us to import a module and use it in other files


• ES6 provides two ways to export a module from a file: named export
and default export.
Default Export: (export default) REACT

• One can have only one default export per file.


• When we import we have to specify a name
Named Export: (export) REACT

• With named exports, one can have multiple named exports per file.
• Then import the specific exports they want surrounded in curly
braces.
• The name of imported module has to be the same as the name of the
exported module.

You might also like