I'm reading this from the exploringjs about ES6
17.1.2 Single default export
There can be a single default export. For example, a function:
//------ myFunc.js ------ export default function () { ··· } // no semicolon! //------ main1.js ------ import myFunc from 'myFunc'; myFunc();
Or a class:
//------ MyClass.js ------ export default class { ··· } // no semicolon! //------ main2.js ------ import MyClass from 'MyClass'; let inst = new MyClass();
Note that there is no semicolon at the end if you default-export a function or a class (which are anonymous declarations).
Why do you not use a semi-colon at the end of the export default declaration? I thought you end all statements with semi-colons?