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
iconprop. 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.๐๐ฝ