When to use default export and export?

After going through the project on GitHub it seems to me that exportthey export defaultare used interchangeably. I also know that when used export default, the bracket is omitted. I am wondering if there is a difference between the two keywords? perhaps efficiency? or coding agreement?

As far as I know for export::

export function Directive () {}

To import a constructor, we need to put { }for the name of the constructor:

import { Directive } from './someDir'

Instead export defaultwe do not need { }.. ie:

import Directive from './someDir'
+4
source share

Source: https://habr.com/ru/post/1624896/


All Articles