Monday, January 15, 2018

Using Default Exports


I don't really like them to much.  Yes they are flexible; but when you go looking through code to find where they are used, the only way to be sure that you find them all is to do the following:
  1. Search for the file name.
  2. Look at each import and see if it is using the default.
  3. Use the name of the default to search in the file
I prefer to used the named include.  Using the named to look through code is more straightforward.
  1. Search the code for the name of exported.
  2. All references to it will show up include the import.
The 'named' import gives a nice view of both where it is being imported and where it is being used all at the same time.  Yes, I prefer to used the 'named' import.

No comments:

Post a Comment