I would like to render a material design icon directly in my NextButton
component using webpack. Here's the relevant part of my code:
var NextIcon = require('material-design-icons/navigation/svg/production/ic_chevron_right_18px.svg');
var NextButton = React.createClass({
render: function() {
return (
<Link to={this.props.target} className='button--next'>
{this.props.label} {NextIcon}
</Link>
)
}
});
But this isn't working as I thought it would. It seems to output the svg as a string, rather than an element.
I've tried using raw-loader
, img-loader
, url-loader
, file-loader
and svg-loader
but I can't find the correct way to do this.