简体   繁体   中英

Material-UI include only certain component

I just want to include material ui dialogs in my project. I do not want to include other components in my project. So I don't want to install full material ui just to use dialogs. Can anyone help with this?

https://material-ui.com/components/dialogs/

According to the documentation ,

Tree-shaking of Material-UI works out of the box in modern frameworks. Material-UI exposes its full API on the top-level @material-ui import.

Which means importing exactly what you're using will not result into the inclusion of other parts of @material-ui/ in your production build.

Note all of their examples import only the bits used in that particular example, so figuring out what your project needs for each case should not be difficult. Besides, whenever you're missing something, you'll get a descriptive error message about it, telling you exactly what you missed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM