What is the difference between using
import { Devices } from '../models/devices';
and
import Devices from '../models/devices';
I haven't been able to google this one out yet.
What is the difference between using
import { Devices } from '../models/devices';
and
import Devices from '../models/devices';
I haven't been able to google this one out yet.
I believe the first is a Named-Import
and the second is a Default-Binding
.
In simple English, I think the first one means "from all the stuff that was exported in ../models/devices
, import only the Devices
object". While the second one means "whatever is the default export of ../models/devices
, import it as the name Devices
.
See the standard. I must admit, though, I'm not 100% my interpretation is correct. That document was not written for mere humans to read, it seems... :/