Your interpretation is correct.
import default from "./chooser"
It is right. The Chooser thing exported by default and when importing you should use the name assigned to it with as ... :
import { Chooser } from "./chooser";
export result from # 1 as Chooser
This is also correct. Name Chooser sets the default new name and exports it.
Let me break this:
export { default as Chooser } from "./chooser";
This means that the file from which it is exported, and default as Chooser exports the default value named Chooser . Now, when importing:
import { Chooser } from "./chooser";
You must specify Chooser to import, since you essentially named the default value.
Li357
source share