Named exports are better than default ones (mostly)
August 12, 2022•1,530 words
This article talks about the difference between the different module export types, Default vs Named exports in ES6 modules, and why named exports are the preferred option in most cases.
tl;dr
Prefer named exports over default exports as named imports are explicit and have better type/editor support.
What is a default export?
ES6 module default exports comes from replicating the functionality of exporting modules in the CommonJS spec. Let's take a look at the following piece of code:
// src...
Read post