You need to sign in to do that
Don't have an account?
smriti sharan19
Named Exports in Lightning Web Component
Can we have named export in Lightning Web Component?
In ES6 module there are two ways of exporting module:
Default Export
Named Export
I am able to find deault export in lwc
According to ES6
There can be several named exports in a ES6 module. A module can export selected components using the syntax given below −
In ES6 module there are two ways of exporting module:
Default Export
Named Export
I am able to find deault export in lwc
export default class HelloWorld extends LightningElement {}But I have not seen named export in LWC so want to know if they are used in lwc?
According to ES6
There can be several named exports in a ES6 module. A module can export selected components using the syntax given below −
//using multiple export keyword export component1 export component2 ... ... export componentN
Lightning Web Components JavaScript support includes:
ES6 (ECMAScript 2015) which means named exports is supported although there are no documented examples
usage is as follows
Let me know if this helps
Anudeep
export default class HelloWorld extends LightningElement {}