svg-sprite-loader how to use https:// svg link data source?

17 views Asked by At

Use case: I am building out a site where the client wants to be able to select and upload their own svg icon for their site.

I have decided to use svg-sprite-loader as a method to reduce overhead on the client side. I am trying to wire up the CMS to the front-end and am running into challenges getting the SVG's to render.

iconPath: will return a path as such: /uploads/this-is-a-file-name.svg

I am not sure what I am doing wrong to try and implement this?

I have tried using and it was successful but removes the ability to change the icon color based on its setting.

My current implementation:

   <svg>
        <title>{IconCaption}</title>
        <use
          xlinkHref={`http://localhost:1337${iconPath}`}
        />
      </svg>
0

There are 0 answers