Why is exporting/importing default ES module properties faster than names module properties?

前端 未结 1 737
梦如初夏
梦如初夏 2021-01-19 03:59

I\'m reading the Material UI documentation, and it states:

Notice that in the above example, we used: import RaisedButton from \'material-ui/R

相关标签:
1条回答
  • 2021-01-19 04:27

    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.

    0 讨论(0)
提交回复
热议问题