The best way to use icons is ansvg spritesheet. This is one of the oldest tactics to optimize image loading. Instead of loading many small images, we load a single image and use code to display only the part we need. We will also build a React component that displays a specific icon by name with full type safe autocomplete.
Table of contents
Create a folder for iconsCreate a list of icons in your appCompile icons into a single spritesheetCreate a React component that displays an iconCreate a JSON file with the list of iconsGenerate the JSON file automaticallyRun the script automaticallyPreload svg spriteSort: