[material-ui-icons] reduce code duplication?
See original GitHub issueI’ve noticed, that every file in src
directory implements props forwarding, sets muiName
, checks global.__MUI_SvgIcon__
and so on, which leads to code duplication in bundle.
Generally, the unique content of every icon is it’s path
. All other stuff is common for every icon.
So it should be possible to create single HOC, which does all common stuff. Then use it in every file, providing path
and export the result.
What do you think?
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:7 (7 by maintainers)
Top Results From Across the Web
[material-ui-icons] reduce code duplication? #10900 - GitHub
I've noticed, that every file in src directory implements props forwarding, sets muiName , checks global.__MUI_SvgIcon__ and so on, ...
Read more >Minimizing bundle size - Material UI - MUI
DX : This syntax reduces the duplication of code, requiring only a single import for multiple modules. Overall, the code is easier to...
Read more >How to increase material-ui icons? - Stack Overflow
Try adding the label style of the button like below import ArrowUp from 'material-ui-icons/KeyboardArrowUp' <Button fab color="primary" ...
Read more >@material-ui/icons | Yarn - Package Manager
This package provides the Google Material icons packaged as a set of React components. Installation. Install the package in your project directory with:...
Read more >How to Reduce Code Duplication? | React.js | Devtools Tech
In this video we are going to discuss a particular case related to reducing code duplication in our React Apps by abstracting out...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
BTW, looks like I wasn’t talking about HOC in classical term, it’s indeed more like a factory. Anyway, I’ll submit a PR soon, please take a look. No pressure 😉
Ok, I’ll submit a PR then 😃