Importing and rendering inline SVGs #1695
-
Is there a way for consumers to update Remix's config to support importing SVG assets and rendering them inline? Rendering inline SVGs is advantageous for a couple of reasons:
Intended use case: import SvgClose from './assets/close.svg'; // asset file containing SVG markup
return (
<button>
<SvgClose aria-hidden style={{ fill: 'red' }}/> {/* params get passed to <svg> html element */}
<span className="visually-hidden">close</span>
</button> By default, it seems that |
Beta Was this translation helpful? Give feedback.
Answered by
sergiodxa
Jan 28, 2022
Replies: 1 comment
-
The compiler is not configurable, you can transform the SVG to JSX manually and import it as a component |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
tsteinke-iabbb
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The compiler is not configurable, you can transform the SVG to JSX manually and import it as a component