- My goal: I have a icon that uses svg files
- Issue: SVG file does not load properly
- Steps I've taken to troubleshoot:
- Additional info:
my test files.
CalendarIcon.tsx
import React from 'react';
import './styles.css';
const CalendarIcon = () => (
<i className="calendar" />
);
export default CalendarIcon;
styles.css
.calendar {
display: inline-block;
width: 48px;
height: 48px;
background-image: url(./images/icons/calendar.svg);
}
index.tsx
export const Test: FC = () => {
return (
<CalendarIcon />
);
}
In the browser console, I'm getting this error.
