Yes, the name of the svg file will be passed as the icon prop. The label prop is used for accessibility (for screen readers).
Theoretically, the icons could be discarded since the only thing we need is the svg sprite. But you don’t want to do that for several reasons
Version control. Ideally the sprite itself should not be committed to version control (to avoid merge conflicts). Hence the script generating the sprite (grunt) should be run as part of your CI/CD process, so you’ll want the icons to be there when that is run
You’ll need to add new icons someday (the point is to be able to automate it). If you’d deleted previous icons and then added new icons, the new sprite generated will only contain the new icons and you would’ve lost your previous icons
Yes, the name of the svg file will be passed as the
icon
prop. The label prop is used for accessibility (for screen readers).Theoretically, the icons could be discarded since the only thing we need is the svg sprite. But you don’t want to do that for several reasons
Version control. Ideally the sprite itself should not be committed to version control (to avoid merge conflicts). Hence the script generating the sprite (grunt) should be run as part of your CI/CD process, so you’ll want the icons to be there when that is run
You’ll need to add new icons someday (the point is to be able to automate it). If you’d deleted previous icons and then added new icons, the new sprite generated will only contain the new icons and you would’ve lost your previous icons
Makes sense. Thanks for the clarification.👍🏽