- Find Usages/Find References - Easier to search for the export across the project. Less likely to have been renamed or misspelled
- Easier refactoring of the exported name
- No need to think of a variable name. Sometimes it's unclear from the file name, especially if it's
../index.js
- Choosing a named export with IntelliSense autocomplete is faster than writing your own variable. Also prevents spelling mistakes
- If we only had named exports, it would be easier for new developers to learn how to use it, as there is no extra logical step of choosing which type of import or export to use
- In case of importing several files with the same name, it's easier to name the import as different variables instead of the verbose
{ foo as fooBar }
of named exports - The import looks cleaner
- Doesn’t make sense for React hooks, stores, constants, utility files or even components where the developer wishes their component to be imported by name explicitly
- Has substantial resources against
export default
in general