Want to set up an inline svg with webpack? Actually Michelle’s answer pointed me in the right direction, and that works nicely for loading an svg file with webpack and using it as your
src.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | import React, { Component } from 'react' import logo from "./logo.svg"; class Header extends Component { render() { return ( <div className='header'> <span dangerouslySetInnerHTML={{__html: logo}} /> </div> ); } }; export default Header |
It looks like there is an inline svg wrapper for react svg-inline-react which would be another option instead of the
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.