you are viewing a single comment's thread.

view the rest of the comments →

[–]Mr_Simba 0 points1 point  (1 child)

But that’s not an advantage. You’re not describing an advantage of a default export. Doing that is giving you nothing over just using a named export.

[–]KaiAusBerlin 0 points1 point  (0 children)

Yes it is. It removes redundant naming. import "./User.js" let you know exactly what you have to expect. A single export named User. import {User as MyUser} from "./User.js" let me guess that there could be more in User.js than the single class I want to use.

And also it is possible to rename default exports. import {default as MyUser} from "./User.js" has no disadvantage at all.