What are some use cases for using named imports with the import keyword (to import a default export)?
Answer
We can combine named imports with the import statement (to import a default export) for the same reasons we would combine named exports and default exports.
Generally, this includes importing the expected export of a module, the default export, importing any utility exports that may not be necessary but could come in handy, the named exports, and/or importing pieces of a module that are the internals of a private variable without exposing the entire private variable (again these would be named exports).
I like this way too, as itās easier to use it in the new file. Otherwise, I have to go back to the old file to check, what was the name of the object, with import * as ā¦ I can just choose a new name.
So would this be a good place to slot in this thought: Iām worried about the Alias function (not Jennifer Garner ) if you get too cutesy can you imagine a night mare of flags on the play because aliases got forgotten and thatās the real mistake the error message was trying to get you to fix the WHOLE time? is this a nightmare scenario or plausible concern?
This scenario makes total sense. I think is an important matter to be aware and careful about if we decide to follow the āaliasā path.
Maybe the āalias nightmareā can be related with the ācallback ā ā ā ā ā (?).