What is the difference between an import with parentheses and without them

0

I'm working with meteor and react, in the main.js file I import two kinds of different sites for example

import {Players} from './../imports/api/players';
import TitleBar  from './../imports/ui/TitleBar';

What is the difference between one and the other or to what parentheses are due in one and not in the other or that depends, thanks!

    
asked by Gerardo Bautista 13.07.2017 в 20:23
source

1 answer

3

In the first case you are only importing member Players and assigning it to variable Players .

In the second case you are importing the entire module under the variable TitleBar .

The complete syntax can be seen in import - JavaScript | MDN

    
answered by 13.07.2017 / 20:36
source