Skip to content Skip to sidebar Skip to footer

Why Is Exporting/importing Default Es Module Properties Faster Than Names Module Properties?

I'm reading the Material UI documentation, and it states: Notice that in the above example, we used: import RaisedButton from 'material-ui/RaisedButton'; instead of import {Ra

Solution 1:

The key thing is not whether the module has a default export or not, but the fact that you import a module that includes all the Material UI Components (the material-ui module) instead of the module that includes only the RaisedButton component (the material-ui/RaisedButton module).

To be absolutely clear: We should be using the module that only includes a single component, i.e. material-ui/RaisedButton.

Post a Comment for "Why Is Exporting/importing Default Es Module Properties Faster Than Names Module Properties?"