SVG: use axios.get instead of fetch

This commit is contained in:
martin-mfg
2025-10-15 20:24:54 +02:00
parent da1d21cda9
commit fb4a334f08
+4 -2
View File
@@ -3,6 +3,7 @@
import React, { useEffect, useRef, useState } from 'react';
import PropTypes from 'prop-types';
import axios from 'axios';
import Skeleton from 'react-loading-skeleton';
import 'react-loading-skeleton/dist/skeleton.css';
@@ -15,8 +16,9 @@ const SvgInline = (props) => {
useEffect(() => {
setLoaded(false);
fetch(url)
.then((res) => res.text())
axios
.get(url)
.then((res) => res.data)
.then(setSvg)
.then(() => setLoaded(true))
.catch((e) => console.error(e));