Dynamically loading icons

On screens that only have a handful of icons on them, you can directly import them as components without any issues. This can be challenging if you have a screen with many icons or if your application as a whole uses lots of icons (the latter case increases the bundle size). The answer, in both cases, is to load Material-UI icons lazily/dynamically.

Get React Material-UI Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.