0

Hello i am trying to finish one tutorial with a whats up clone in JS.I would like to know if both are external components from material depedencies why the call is diffent? Why we use brackets in the second and dont give the excact directory and why we do this opposite in the first

import MoverIcon from '@material-ui/icons/MoreVert'
import {SearchOutlined} from '@material-ui/icons';
Felix Kling
  • 795,719
  • 175
  • 1,089
  • 1,143
  • *"and dont give the excact directory"* Which package identifier to use really depends on the structure of the package. I.e. if I have a module at `foo/bar.js` and I want to import that then I'm going to use `"foo/bar"` as identifier. In this case it looks like `@material-ui/icons` is a directory (with an `index.js` file) and it looks like every module is re-exported by `index.js` as a named export. Or maybe not. Maybe `index.js` only exposes some modules but not others. The only way to know for sure which way works is to look at the source. – Felix Kling Sep 23 '20 at 12:40
  • Thank you i went further in documentation and figured it out.You were handy. – Dimitris Xitas Sep 25 '20 at 10:43

0 Answers0