Answer the question
In order to leave comments, you need to log in
Why specify the full path to the js file if there is tree shaking?
Good afternoon, I look at the manuals and a lot where this design is used:
import AppBar from '@material-ui/core/AppBar';
import ToolBar from '@material-ui/core/ToolBar';
// тут еще 20 импортов таких же
import {
AppBar,
ToolBar,
// other
} from '@material-ui/core';
Answer the question
In order to leave comments, you need to log in
Export through brackets - named:
//module.js
function myModule() {...}
export { myModule }
//other.js
import { myModule } from 'module.js'
//module.js
function myModule() {...}
export default myModule();
//other.js
import myModuleOtherName from 'module.js' // для default можно использовать любое имя
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question