Dinamyc inline svg
hi everyone, good night i have a question, i am new whit solid js and i want to make a component that can render svg dynamically, these svg are in my public directory, so an example of this cloud be react-svgr, his library can import the svg an render as a component, the result is a inline svg and ou can change his props
https://react-svgr.com
I saw this method in react to import dinamically a svg, it is posible to make this in solidjs ?
https://stackoverflow.com/questions/61339259/how-to-dynamically-import-svg-and-render-it-inline
SVGR - Transforms SVG into React Components. - SVGR
Transforms SVG into React Components.
Stack Overflow
How to dynamically import SVG and render it inline
I have a function that takes some arguments and renders an SVG. I want to dynamically import that svg based on the name passed to the function. It looks like this:
import React from 'react';
export
4 Replies
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
something like that
it doesnt have to be at compile time, it can be whit a dinamyc import for example like the example
there's a vite plugin for that: https://github.com/jfgodoy/vite-plugin-solid-svg
GitHub
GitHub - jfgodoy/vite-plugin-solid-svg: Vite plugin to Import SVG f...
Vite plugin to Import SVG files as Solid.js Components - GitHub - jfgodoy/vite-plugin-solid-svg: Vite plugin to Import SVG files as Solid.js Components
thanks this work for me for now